Skip to content

Multi-Agent Swarms

Swarms are groups of agents working in parallel on decomposed tasks. AgentCTX’s orchestrator manages spawn, coordination, and result aggregation.

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
Terminal window
actx swarm manifest.yaml
name: feature-implementation
phases:
- 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-opus
  1. Decompose — break the task into parallelizable work items
  2. Dispatch — spawn agents for each work item
  3. Monitor — track progress via actx top or actx dashboard
  4. Coordinate — agents share state through team memory
  5. Aggregate — collect results and resolve conflicts
  6. Report — generate summary of all agent work
Terminal window
# Real-time process tree
actx top
# Dashboard with metrics
actx dashboard

The dashboard shows:

  • Agent status (running, waiting, complete, failed)
  • Phase progress (which phases are active)
  • Token budget consumption per agent
  • Coherence alerts (duplicate work detected)

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 +confirm
ScenarioBehavior
Agent failsRetry with same prompt, then escalate
Budget exceededPause agent, notify orchestrator
Coherence conflictMerge or ask human to resolve
Phase dependency failsBlock downstream phases