Multi-Agent Orchestration
Multi-Agent Orchestration
Section titled “Multi-Agent Orchestration”AgentCTX’s orchestrator coordinates multiple agents working on complex tasks. This guide covers delegation, process groups, and building multi-agent workflows.
Agent Delegation
Section titled “Agent Delegation”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"Discovery
Section titled “Discovery”Find available agents:
?a "code reviewer" Search by capability?a #security Search by role tag!a agent-123 Lookup by IDProcess Groups
Section titled “Process Groups”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
Handoff Protocol
Section titled “Handoff Protocol”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"Cognition Traces
Section titled “Cognition Traces”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 traceNATS-Based Communication
Section titled “NATS-Based Communication”Multi-agent communication uses NATS JetStream:
| Pattern | Use |
|---|---|
| Pub/Sub | Broadcast updates to all agents in a group |
| Queue Groups | Load-balance tasks across available agents |
| Request/Reply | Synchronous agent-to-agent queries |
| JetStream | Durable messaging with replay |
Dispatch Commands
Section titled “Dispatch Commands”The CLI provides tools for orchestration:
actx dispatch <prompt> Dispatch a task to an agentactx swarm <manifest> Launch a multi-agent swarmactx top Monitor all running agentsactx dashboard View orchestration metricsSee Also
Section titled “See Also”- Agents Plane — the
aplane - Pipeline Verbs — cognition trace verbs
- actx top — real-time agent monitor