Swarm System
Coordinate multiple AI agents working together on complex tasks.
Overview
The swarm system enables multiple agent instances to work together as a team. Each agent has an identity, mailbox, task queue, and can communicate with other agents in the swarm.
Architecture
Agent A (Coordinator)
├── Agent B (Researcher)
│ └── Agent D (Data Collector)
├── Agent C (Implementer)
└── Agent E (Reviewer)
Agents communicate via a message bus. Each agent has its own:
- Identity — name, role, capabilities
- Mailbox — receives messages from other agents
- Task queue — pending and completed tasks
- Result channel — output is collected by the coordinator
Execution Modes
| Mode | Description |
|---|---|
| Pane/tmux | Each agent runs in its own terminal pane |
| In-process | Agents run as lightweight coroutines within the same process |
Swarm vs. Subagent
| Subagent | Swarm/Teammate |
|---|---|
| One-shot, isolated | Persistent, collaborative |
| No inter-agent communication | Full mailbox system |
| Results returned once | Continuous coordination |
| Best for exploration | Best for long-running complex tasks |
Swarm Commands
❯ /agents # open agent dashboard
❯ /agent dispatch ... # dispatch a subagent