# Orchestration and multi-agent

> When one agent is not enough, something has to coordinate several. This topic contrasts orchestration written as code with orchestration decided by a model, surveys sequential, hierarchical and collaborative arrangements, and names the coordination cost that every extra agent adds.

Page: https://schubergphilis.github.io/ai-training/topics/building-agents/orchestration/
License: CC BY-SA 4.0, https://creativecommons.org/licenses/by-sa/4.0/

*Building agents* · topic `building-agents/orchestration`

When one agent is not enough, something has to coordinate several. This topic contrasts orchestration written as code with orchestration decided by a model, surveys sequential, hierarchical and collaborative arrangements, and names the coordination cost that every extra agent adds.

## Concepts

- **Code- vs model-driven orchestration**: Two ways to coordinate agents. In code-driven orchestration a program decides which agent runs when, passing outputs along fixed paths; it is predictable, testable and cheap. In model-driven orchestration a model decides, delegating to other agents as tools; it adapts to unforeseen cases and is harder to bound. Use code for known workflows and a model for the genuinely open parts. [glossary](https://schubergphilis.github.io/ai-training/glossary/#code-vs-model-driven-orchestration)
- **Sequential / hierarchical / collaborative**: Three arrangements. Sequential: agents form a pipeline, each transforming the previous output. Hierarchical: a manager agent delegates subtasks to workers and integrates their results. Collaborative: peer agents share a workspace or conversation and negotiate. Complexity and unpredictability rise in that order; sequential is enough far more often than it seems. [glossary](https://schubergphilis.github.io/ai-training/glossary/#sequential-hierarchical-collaborative)
- **Orchestration tax**: The cost every additional agent adds: more tokens for handoffs and repeated context, latency from extra calls, information lost at each boundary, new failure modes when agents disagree or wait on each other, and harder debugging. A multi-agent design has to beat a single well-equipped agent by more than this tax, and often it does not. [glossary](https://schubergphilis.github.io/ai-training/glossary/#orchestration-tax)

## Links

- **Builds on:** [Design patterns](https://schubergphilis.github.io/ai-training/topics/building-agents/patterns/)
- **Leads to:** nothing yet
- **Competencies drawing on it:** [Designs and orchestrates multi-agent systems](https://schubergphilis.github.io/ai-training/competencies/building-agents/orchestrates-agents/)

## Lessons

- [Orchestration in code or by a model](https://schubergphilis.github.io/ai-training/building-agents/orchestrating-agents/) (tutorial)
- [What every extra agent costs](https://schubergphilis.github.io/ai-training/building-agents/orchestration-tax/) (explanation)

## Sources

- `AEC-07` [Multi-agent systems: architectures, roles, the orchestration tax](https://lsimons.github.io/agent-engineer-course/07-multi-agent-systems/), Agent Engineer Course (course)
- `AEC-18` [Orchestrators: code- versus model-driven, patterns, anti-patterns](https://lsimons.github.io/agent-engineer-course/18-orchestrators/), Agent Engineer Course (course)
- `Academy claude-platform-101` [Claude Platform 101](https://academy.claude.com/courses/claude-platform-101), Claude Academy (course)
- `Academy introduction-to-subagents` [Introduction to subagents](https://academy.claude.com/courses/introduction-to-subagents), Claude Academy (course)
- `OpenAI Academy design-and-build-agentic-systems-k5uke` [Design and Build Agentic Systems](https://academy.openai.com/public/courses/design-and-build-agentic-systems-k5uke), OpenAI Academy (course)
