ORCHESTRATION PATTERNS
How AI agents coordinate in multi-agent systems.
Hierarchical
A manager agent delegates subtasks to specialized worker agents and aggregates their results. The manager controls planning, task decomposition, and final synthesis. Workers operate independently and report back to the manager.
[Manager]
/ | \
/ | \
v v v
[Worker] [Worker] [Worker]
A B C
- Complex projects requiring task decomposition and coordination
- Research pipelines where a lead agent assigns analysis tasks
- Customer support escalation workflows
- Content creation with editor-writer hierarchies
- Clear chain of command and accountability
- Manager can re-plan dynamically based on worker outputs
- Workers can be specialized and independently developed
- Manager is a single point of failure
- Can be slower due to sequential manager-worker communication
- Manager context window can become a bottleneck
Sequential
Agents execute in a fixed pipeline order, each passing its output as input to the next. The chain processes data through a series of transformation or analysis stages, similar to a Unix pipeline.
[Agent A] --> [Agent B] --> [Agent C] --> [Agent D]
(input) (transform) (analyze) (output)
- Data processing pipelines (extract, transform, load)
- Content pipelines: research -> draft -> edit -> publish
- Code review chains: lint -> security scan -> style check
- Document processing: parse -> summarize -> translate
- Simple to understand, debug, and monitor
- Each stage can be independently tested and swapped
- Predictable execution order and resource usage
- No parallelism — total latency is sum of all stages
- Failure in one stage blocks the entire pipeline
- Rigid structure makes dynamic re-routing difficult
Swarm
Peer-to-peer agent coordination where agents hand off tasks to each other dynamically based on context. There is no central controller — agents decide when to transfer control to a more appropriate peer, enabling emergent collaborative behavior.
[Agent A] <--> [Agent B]
^ \ ^
| \ /
v v v
[Agent D] <--> [Agent C]
- Customer service with specialist handoffs (billing, tech, sales)
- Multi-domain problem solving requiring diverse expertise
- Collaborative coding with specialized language agents
- Adaptive workflows where the path depends on content
- Highly flexible and adaptive routing
- No single point of failure
- Agents self-organize based on task requirements
- Harder to debug and trace execution paths
- Risk of infinite loops between agents
- Emergent behavior can be unpredictable
Router
A central router agent classifies incoming requests and dispatches them to the most appropriate specialist agent. The router acts as an intelligent switchboard, analyzing the task and selecting the best handler without performing the work itself.
[Router]
/ | \
v v v
[Specialist] [Specialist] [Specialist]
Code Data Writing
- API gateways that route to domain-specific agents
- Help desks that triage and assign to specialist teams
- Multi-model routing based on task complexity or type
- Tool selection based on input classification
- Clean separation of routing logic from execution
- Easy to add new specialists without changing routing logic
- Can incorporate cost/latency optimization in routing decisions
- Router must understand all specialist capabilities
- Classification errors send tasks to wrong specialists
- Single-hop dispatch — no multi-step collaboration
Debate
Multiple agents independently analyze a problem and then critique each other's outputs through structured argumentation. A judge or consensus mechanism selects or synthesizes the best answer. This adversarial approach improves output quality through diverse perspectives.
[Agent A] [Agent B]
\ /
v v
[ Debate ]
\ /
v v
[Judge]
- High-stakes decisions requiring multiple perspectives
- Code review with competing analysis approaches
- Legal or policy analysis with adversarial argumentation
- Fact-checking and claim verification
- Produces higher-quality outputs through adversarial pressure
- Surfaces edge cases and counterarguments
- Reduces single-agent bias and hallucination
- High token usage — multiple full analyses plus debate rounds
- Slower due to multiple rounds of generation
- May produce deadlocks when agents strongly disagree