The single-agent limit
Consider packaging everything — the model, the harness, and its loop — into one agent unit and giving it a large goal such as:- “Research 12 vendors, compare them, and write a recommendation.”
- Context truncation (important history removed)
- Loss of coherence across steps
- Degraded or incorrect final output
The orchestration solution
Instead of having one agent try to do everything, make the top-level agent an orchestrator. The orchestrator’s job is to:- Decompose the large goal into smaller, well-defined subtasks.
- Dispatch those subtasks to other agents (subagents).
- Collect, validate, and stitch subagent results back into the final output.
- A research subagent that gathers vendor facts.
- A comparison subagent that evaluates and scores vendors.
- A writing subagent that drafts the recommendation.
A subagent behaves, from the orchestrator’s perspective, like a tool call: the orchestrator requests a result, waits for it, and receives the response. The orchestrator does not need to know the subagent’s internal model, tools, or loop — it only needs the output.
Key characteristics and design principles
- Reuse one building block: The entire system is the same agent design repeated at multiple levels. You do not invent new primitives — you reuse the agent pattern.
- Subagents as tools: To the orchestrator, subagents are abstractions that return results, analogous to calling a web API or a local tool.
- Recursive orchestration: Subagents may orchestrate further subagents, enabling hierarchical or distributed processing.
- Flexible orchestrators: The orchestrator can be an AI agent, or it can be plain code using a static plan. Use whatever fits your reliability and control needs.
- Multiple topologies: The architecture can be hierarchical, chain-based, peer-to-peer, or a hybrid. Agents can fan-out, pass work sideways, or collaborate in complex graphs.
Quick reference table
Example workflow (step-by-step)
- Orchestrator receives goal: “Research 12 vendors, compare them, write recommendation.”
- Orchestrator decomposes goal:
- Create a “vendor-research” task per vendor
- Create a “compare” task to aggregate results
- Create a “draft” task to produce the final recommendation
- Orchestrator spawns subagents (or calls an orchestration API) and supplies each subagent with its task specification and data schema expectations.
- Each subagent runs independently within its own context window and returns structured results.
- Orchestrator validates or normalizes results, runs the comparison logic, and asks the writing subagent to draft the recommendation.
- Orchestrator produces the final consolidated output and returns it to the user.
When to use subagents
- The task requires memory beyond a single context window (long-running research, large datasets).
- You need robustness and modularity (isolated failures only affect one subtask).
- You want parallelism (multiple subagents operate concurrently).
- You need specialized processing (different subagents can use different tools, prompts, or models).
Benefits and trade-offs
Benefits:- Scalability through horizontal decomposition (scale out, not up).
- Improved fault isolation and recoverability.
- Easier reuse and specialization of subagents.
- Additional orchestration complexity (task splitting, result merging, retries).
- Potential latency from inter-agent calls and coordination.
- Need for well-defined interfaces and schemas between agents.