Multi-Agent Orchestration
Orquestador–trabajadores · Subagentes
Escrito por Darjus Kazakevic · revisado el
Give each sub-task its own context — and get a distributed system.
Multi-agent systems are often sold as a team of personas: a researcher, a writer, a critic. The personas add little. The real gain is that each sub-agent has its own context window. Six workers each read one file and return a summary. The coordinator sees six paragraphs, not sixty thousand tokens of transcript.
The cost is every distributed-systems problem: partial failure, duplicated work, results to merge. And the interface between agents is natural language, which no compiler can check. Use this when a task does not fit in one window, and not before.
En esencia — Sub-agents buy isolation: a clean context window for each task. You pay with the coordination costs of a distributed system whose interfaces are prose.
Cuándo recurrir a él
Recurre a él cuando
- The work does not fit in one context window
- Independent sub-tasks can run in parallel and save real time
- Sub-tasks need different tools or trust: read-only research, one writer
Reconsidéralo cuando
- One agent with good tools would do, which is most of the time
- Sub-tasks depend on each other, so nothing runs in parallel
- The real problem is a weak prompt or vague tool descriptions
The parts
- The orchestrator (The lead)
- The agent that splits the goal, sends out work and merges the results. It holds the only full picture of the task, so its context is the one to protect.
- The worker (Sub-agent)
- An agent with a fresh context, a narrow set of tools and one job. It starts clean, does the work, returns a result, and its transcript is thrown away.
- The handoff (The brief)
- What the orchestrator sends and what the worker returns. This is the system's interface. By default it is prose, and that is where multi-agent systems usually fail.
- The merge
- Combining the results into one answer. This is real work: workers overlap, contradict each other, and report the same finding in different words.
Reglas de diseño
- Split for context, not for personality
- A sub-agent is worth it when its work does not fit, or does not belong, in the parent's window. A persona like “meticulous reviewer” adds nothing a good prompt would not. Name the context problem each worker solves.
- Make the handoff a schema
- The brief holds the task, inputs, output shape and budget. The worker returns a typed result, never its transcript. Returning full transcripts keeps the cost and loses the isolation.
- Budget each worker and the whole tree
- Nested loops multiply. Three workers at forty turns each is 120 model calls from one request. Set caps per worker and one for the whole tree, and keep the tree one level deep.
- Give each resource one writer
- Two agents editing the same file is a lost update. Give write access to a resource to one worker only, or send all writes through the orchestrator. Run in parallel only work that is truly independent.
Errores habituales
- Personas instead of isolation. A role name does nothing for the context window.
- Prose handoffs, so a misunderstood brief shows up three steps later.
- No budget for the whole tree, so the invoice is the first alert.
- Adding agents to fix accuracy when the real problem was the tool descriptions.