Skip to content

Multi-Agent Orchestration

AgentCTX’s orchestrator coordinates multiple agents working on complex tasks. This guide covers delegation, process groups, and building multi-agent workflows.

The ^ (delegate) operator dispatches work to other agents via the agents plane:

^a code-review agent="claude-opus" context="PR #42"
^a security-audit agent="security-agent" context="auth module"
^a documentation agent="gemini-flash" context="API reference"

Find available agents:

?a "code reviewer" Search by capability
?a #security Search by role tag
!a agent-123 Lookup by ID

Agents working on related tasks are organized into process groups:

Orchestrator
├── Agent A (code review) → Process Group "PR-42"
├── Agent B (security audit) → Process Group "PR-42"
└── Agent C (documentation) → Process Group "docs-sprint"

Process groups enable:

  • Coherence detection — prevent duplicate work
  • Dependency ordering — ensure tasks execute in the right sequence
  • State sharing — agents in the same group share team-level memory

When one agent completes its portion, it hands off state to the next:

// Agent A finishes code review
+m:handoff "review complete, 3 issues found" #state
+m:context "Issues: SQL injection in search, XSS in comments, missing rate limit"
// Agent B picks up security audit
?m #handoff @1h Find recent handoffs
?m @traverse "PR-42-review" Get full context graph
+m:context "continuing from code review handoff"

Pipeline verbs create structured reasoning traces that persist across agent handoffs:

// Agent A's trace
+m:context "reviewing PR #42"
+m:check "code style compliance"
+m:edge "SQL injection in search endpoint"
+m:escalate "critical security issue" #p0
// Agent B sees Agent A's full reasoning
?m #pipeline @1h ^20 Get recent cognition trace

Multi-agent communication uses NATS JetStream:

PatternUse
Pub/SubBroadcast updates to all agents in a group
Queue GroupsLoad-balance tasks across available agents
Request/ReplySynchronous agent-to-agent queries
JetStreamDurable messaging with replay

The CLI provides tools for orchestration:

Terminal window
actx dispatch <prompt> Dispatch a task to an agent
actx swarm <manifest> Launch a multi-agent swarm
actx top Monitor all running agents
actx dashboard View orchestration metrics