Multi-Agent Swarms
Multi-Agent Swarms
Section titled “Multi-Agent Swarms”Swarms are groups of agents working in parallel on decomposed tasks. AgentCTX’s orchestrator manages spawn, coordination, and result aggregation.
Concepts
Section titled “Concepts”Orchestrator├── Agent A (frontend) ← Phase 1├── Agent B (backend) ← Phase 1├── Agent C (tests) ← Phase 2 (depends on A + B)└── Agent D (docs) ← Phase 2 (depends on A + B)Key properties:
- Phased execution — tasks execute in dependency order
- Parallel within phases — agents in the same phase run concurrently
- Coherence detection — prevents agents from duplicating work
- Shared memory — all agents in a swarm share team-level memory
Launching a Swarm
Section titled “Launching a Swarm”Via CLI
Section titled “Via CLI”actx swarm manifest.yamlManifest Format
Section titled “Manifest Format”name: feature-implementationphases: - name: implementation agents: - role: frontend prompt: "Implement the login page component" model: claude-sonnet - role: backend prompt: "Implement the auth API endpoint" model: claude-sonnet
- name: validation depends_on: [implementation] agents: - role: tester prompt: "Write integration tests for login flow" model: gemini-flash - role: reviewer prompt: "Review both frontend and backend changes" model: claude-opusSwarm Lifecycle
Section titled “Swarm Lifecycle”- Decompose — break the task into parallelizable work items
- Dispatch — spawn agents for each work item
- Monitor — track progress via
actx toporactx dashboard - Coordinate — agents share state through team memory
- Aggregate — collect results and resolve conflicts
- Report — generate summary of all agent work
Monitoring
Section titled “Monitoring”# Real-time process treeactx top
# Dashboard with metricsactx dashboardThe dashboard shows:
- Agent status (running, waiting, complete, failed)
- Phase progress (which phases are active)
- Token budget consumption per agent
- Coherence alerts (duplicate work detected)
Memory Coordination
Section titled “Memory Coordination”Agents in a swarm communicate through team-level memory:
// Agent A stores a decision+m "auth-approach" #team "Using PASETO tokens"
// Agent B reads team decisions before starting?m #team @1h ^10
// Agent C confirms the approach~m auth-approach #team +confirmError Handling
Section titled “Error Handling”| Scenario | Behavior |
|---|---|
| Agent fails | Retry with same prompt, then escalate |
| Budget exceeded | Pause agent, notify orchestrator |
| Coherence conflict | Merge or ask human to resolve |
| Phase dependency fails | Block downstream phases |
See Also
Section titled “See Also”- Multi-Agent Orchestration — orchestrator architecture
- Agent-to-Agent Communication — messaging patterns
- actx top — process monitor