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:
| Topology | Best For | Structure |
|---|---|---|
| Hierarchical | Complex workflows with clear delegation | Queen coordinates workers in a tree |
| Mesh | Maximum parallelism, equal-weight tasks | All agents connected to all others |
| Ring | Sequential pipelines, even distribution | Each agent passes to the next |
| Star | Centralized coordination | Queen at center, all workers report in |
| Adaptive | Unknown workloads | Auto-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
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:
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:
- Define a goal and current state
- The A* planner finds the optimal action sequence
- Independent actions are grouped for parallel execution
- 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
Swarm Persistence
Save and restore entire swarm states — agents, tasks, specializations, and execution logs:
Cost-Aware Routing
Configure per-model costs and the engine automatically factors cost into agent selection:
Swarm Replay
Every swarm records an execution log for debugging and analysis:
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /swarm/start | Start a new swarm |
| POST | /swarm/stop | Stop the swarm |
| GET | /swarm/status | Get metrics and topology |
| GET | /swarm/snapshot | Full swarm state |
| POST | /swarm/agents | Spawn an agent |
| GET | /swarm/agents | List agents |
| POST | /swarm/tasks | Submit a task |
| POST | /swarm/tasks/batch | Submit task batch |
| POST | /swarm/consensus | Run consensus vote |
| POST/GET | /swarm/topology | Change/view topology |
| POST | /swarm/memory | Store a memory |
| POST | /swarm/memory/search | Semantic search |
| POST | /swarm/plan | Create execution plan |
| GET | /swarm/events | SSE real-time stream |
| GET | /swarm/templates | List templates |
| POST | /swarm/templates/:id/deploy | Deploy template |
| GET | /swarm/specializations | Agent learning data |
| POST | /swarm/persist | Save swarm state |
| POST | /swarm/restore/:id | Restore swarm state |
| GET | /swarm/snapshots | List saved snapshots |
| GET | /swarm/replay | Execution log for replay |
| GET | /swarm/cost | Cost tracking data |
| POST | /swarm/cost/config | Set 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
Model Benchmarking
Compare models on actual swarm tasks to find the optimal assignment:
Fallback Chains
Configure ordered lists of models with automatic failover when a provider goes down:
Per-Agent Cost Tracking
Local Model Support (Ollama)
Run swarms offline using local models via Ollama:
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.
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.
Structure-Aware Search
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.
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