Swarm Intelligence

Multi-agent orchestration with topology control, consensus voting, vector memory, and GOAP goal planning

Bootspring's Swarm Intelligence layer enables coordinated multi-agent orchestration where agents don't just run — they collaborate through shared state, vote on decisions, and dynamically reorganize based on workload.

Topologies

Choose the right agent organization for your task:

TopologyBest ForStructure
HierarchicalComplex workflows with clear delegationQueen coordinates workers in a tree
MeshMaximum parallelism, equal-weight tasksAll agents connected to all others
RingSequential pipelines, even distributionEach agent passes to the next
StarCentralized coordinationQueen at center, all workers report in
AdaptiveUnknown workloadsAuto-switches topology based on performance

Agent Roles

  • Queen — Coordinator that manages topology and task dispatch
  • Worker — General-purpose task executor
  • Specialist — Domain expert (security, performance, architecture)
  • Reviewer — Code review and quality validation
  • Monitor — Health monitoring and metrics collection

CLI Usage

Loading code block...

Swarm Templates

Pre-built configurations for common workflows:

  • code-review — Star topology with security, performance, and style reviewers
  • deploy — Hierarchical with build, test, and deploy specialists
  • security-audit — Mesh topology for parallel vulnerability scanning
  • feature-build — Hierarchical with parallel implementation and testing
  • research — Mesh topology for parallel exploration

Deploy a template:

Loading code block...

Vector Memory

Agents store and recall knowledge using HNSW-indexed vector similarity search:

  • Decisions — Record and recall past architectural choices
  • Patterns — Learn from successful code patterns
  • Errors — Remember and avoid past mistakes
  • Trajectories — Replay successful goal-to-deployment sequences

Search is sub-5ms for 50,000+ entries using approximate nearest neighbor.

Goal Planner (GOAP)

The Goal-Oriented Action Planning system decomposes high-level goals into executable task DAGs:

  1. Define a goal and current state
  2. The A* planner finds the optimal action sequence
  3. Independent actions are grouped for parallel execution
  4. Feed the plan directly into a swarm for execution

Built-in actions cover the full dev lifecycle: analyze, design, implement, test, review, security scan, deploy.

Agent Specialization Learning

Agents improve over time. The engine tracks per-agent, per-task-type performance:

  • Success rate — How often each agent succeeds at each task type
  • Speed — Average duration per task type per agent (EWMA-smoothed)
  • Smart routing — Task dispatch prioritizes agents proven best at each type
  • Persistence — Specialization data survives swarm save/restore
Loading code block...

Swarm Persistence

Save and restore entire swarm states — agents, tasks, specializations, and execution logs:

Loading code block...

Cost-Aware Routing

Configure per-model costs and the engine automatically factors cost into agent selection:

Loading code block...

Swarm Replay

Every swarm records an execution log for debugging and analysis:

Loading code block...

API Endpoints

MethodEndpointDescription
POST/swarm/startStart a new swarm
POST/swarm/stopStop the swarm
GET/swarm/statusGet metrics and topology
GET/swarm/snapshotFull swarm state
POST/swarm/agentsSpawn an agent
GET/swarm/agentsList agents
POST/swarm/tasksSubmit a task
POST/swarm/tasks/batchSubmit task batch
POST/swarm/consensusRun consensus vote
POST/GET/swarm/topologyChange/view topology
POST/swarm/memoryStore a memory
POST/swarm/memory/searchSemantic search
POST/swarm/planCreate execution plan
GET/swarm/eventsSSE real-time stream
GET/swarm/templatesList templates
POST/swarm/templates/:id/deployDeploy template
GET/swarm/specializationsAgent learning data
POST/swarm/persistSave swarm state
POST/swarm/restore/:idRestore swarm state
GET/swarm/snapshotsList saved snapshots
GET/swarm/replayExecution log for replay
GET/swarm/costCost tracking data
POST/swarm/cost/configSet cost configuration

Dashboard

The swarm dashboard at /swarm provides 7 tabs:

  • Overview — Live topology graph (Canvas), metric cards, SSE event feed, spawn/submit forms
  • Agents — Agent table with role, status, completion stats, remove button
  • Tasks — Task queue with priority badges, status tracking, agent assignment
  • Consensus — Run votes with configurable quorum, see results with bar charts
  • Memory — Semantic search across agent memories, store new entries, view stats
  • Metrics — Task/agent breakdown charts, performance bars, uptime/throughput
  • Plan — GOAP planner with visual DAG of parallel execution groups

Multi-Model Deep Integration

Assign specific AI models to specific agents, benchmark their performance, and configure automatic failover:

Model-per-Agent Assignment

Loading code block...

Model Benchmarking

Compare models on actual swarm tasks to find the optimal assignment:

Loading code block...

Fallback Chains

Configure ordered lists of models with automatic failover when a provider goes down:

Loading code block...

Per-Agent Cost Tracking

Loading code block...

Local Model Support (Ollama)

Run swarms offline using local models via Ollama:

Loading code block...

Supported models: Claude (Opus/Sonnet/Haiku), GPT-4o, GPT-4o Mini, Gemini 2.0 Flash, Ollama local.

Models Dashboard

The multi-model dashboard at /swarm/models provides 6 tabs:

  • Overview — Model health status, aggregate stats, provider breakdown
  • Assignments — Assign models to agents, view current assignment table
  • Benchmarks — Model rankings by task type, recent benchmark results
  • Chains — Create and manage fallback chains with visual chain display
  • Costs — Cost summary by model and agent, top spender analysis
  • Ollama — Configure local model, health check, enable/disable

Automatic Memory Recall

Passive per-turn memory recall — every agent message is searched against the vector memory graph and relevant memories are automatically injected into context. No explicit tool calls needed.

Loading code block...

Memory types: decisions, patterns, errors, solutions, preferences, context. Extraction happens automatically from agent responses using pattern detection. Near-duplicates are filtered. Importance decays over time with access-based boosting.

Swarm File-Conflict Detection

Tracks which files each agent has read or written. When an agent writes to a file another agent has read, a conflict event is emitted for real-time notification.

Loading code block...

Enhanced code search that returns the enclosing function, class, or method for each match. Saves context tokens by letting agents understand file structure without reading entire files.

Loading code block...

Returns: { filePath, line, matchText, enclosingScope: { name, kind, line, signature }, language }. Supports TypeScript, JavaScript, Python, Rust, and Go.

MCP Tools

Three MCP tools are available for AI assistants:

  • bootspring_swarm — Swarm lifecycle, agents, tasks, consensus, topology
  • bootspring_memory — Vector memory search, store, trajectories
  • bootspring_plan — GOAP goal decomposition and planning