Orchestration is the design and control mechanism that coordinates multiple agents and tools to accomplish complex tasks that a single agent would struggle with. Anthropic distinguishes between workflows, where LLMs and tools follow predefined code paths, and agents, where the LLM dynamically directs its process and tool use.[1]
What Is Orchestration?
Section titled “What Is Orchestration?”Orchestration is a design approach that coordinates multiple agents, tools, and processing steps to accomplish complex tasks.[1]
The spectrum ranges from a single-agent configuration where one agent handles all processing, to a multi-agent configuration where specialized agents collaborate — the choice depends on task complexity and requirements.
Proper orchestration design delivers the following benefits:
- Complex tasks can be executed in parallel, reducing completion time
- Combining specialized agents improves the quality of each step
- Human confirmation steps can be appropriately incorporated to build highly reliable systems
Three Orchestration Patterns
Section titled “Three Orchestration Patterns”Pattern 1: Single Agent
Section titled “Pattern 1: Single Agent”A simple configuration where one LLM calls all tools directly.
graph TD
User["User"] --> Agent["Agent\n(LLM Core)"]
subgraph Tools["Tools"]
T1["Web Search"]
T2["Code Execution"]
T3["File Operations"]
T4["External API"]
end
Agent --> T1
Agent --> T2
Agent --> T3
Agent --> T4
T1 --> Agent
T2 --> Agent
T3 --> Agent
T4 --> Agent
Agent --> Result["Result"]Characteristics and Use Cases
| Item | Details |
|---|---|
| Advantages | Simple to implement; consistency is easy to maintain since there’s only one context |
| Disadvantages | Context can grow too long for complex tasks; parallel execution is difficult |
| Best suited for | Relatively simple tasks, cases with few tools, prototype development |
Pattern 2: Multi-Agent
Section titled “Pattern 2: Multi-Agent”A configuration where an orchestrator (parent agent) creates the overall plan and delegates individual tasks to specialized sub-agents (child agents). Anthropic’s “orchestrator-workers” pattern similarly describes a central LLM breaking down tasks, delegating to worker LLMs, and synthesizing results.[1]
graph TD
User["User"] --> Orchestrator["Orchestrator\n(Parent Agent)\nPlanning · Task decomposition · Integration"]
Orchestrator --> SubA["Research Agent\nWeb search · Information gathering"]
Orchestrator --> SubB["Writing Agent\nText generation · Editing"]
Orchestrator --> SubC["Review Agent\nQuality check · Proofreading"]
SubA --> |"Gathered information"| Orchestrator
SubB --> |"Generated text"| Orchestrator
SubC --> |"Review results"| Orchestrator
Orchestrator --> Result["Final Output"]Concrete Example: Research Report Generation
- Orchestrator: Decomposes the goal “Create an EV market report” into tasks
- Research Agent: Collects market data and competitor information in parallel
- Writing Agent: Generates report body based on the collected information
- Review Agent: Checks facts and text quality
- Orchestrator: Integrates each agent’s output into the final deliverable
Characteristics and Use Cases
| Item | Details |
|---|---|
| Advantages | Quality improvement through specialization; speedup via parallel execution; context distribution |
| Disadvantages | Requires designing information passing between agents; overhead increases |
| Best suited for | Complex tasks where different expertise is needed at each phase |
Pattern 3: Hierarchical Multi-Agent
Section titled “Pattern 3: Hierarchical Multi-Agent”The most complex configuration, with multiple layers of agent hierarchy. Handles large-scale software development projects and compound tasks resembling organizational structures.
graph TD
User["User"] --> Top["Top-Level\nOrchestrator"]
Top --> Mid1["Middle\nOrchestrator A\n(Frontend)"]
Top --> Mid2["Middle\nOrchestrator B\n(Backend)"]
Mid1 --> Sub1["Coding\nAgent"]
Mid1 --> Sub2["Testing\nAgent"]
Mid2 --> Sub3["API Design\nAgent"]
Mid2 --> Sub4["DB Design\nAgent"]
Sub1 --> Mid1
Sub2 --> Mid1
Sub3 --> Mid2
Sub4 --> Mid2
Mid1 --> Top
Mid2 --> Top
Top --> Result["Completed System"]Characteristics and Use Cases
| Item | Details |
|---|---|
| Advantages | Can systematically decompose large, complex tasks; scales well |
| Disadvantages | High design and implementation complexity; difficult to debug |
| Best suited for | Large-scale software development, tasks requiring multiple independent subsystems |
Pattern Comparison
Section titled “Pattern Comparison”| Aspect | Single Agent | Multi-Agent | Hierarchical |
|---|---|---|---|
| Implementation complexity | Low | Medium | High |
| Parallel processing | Limited | Possible | Possible and efficient |
| Context management | One context | Per agent | Per layer |
| Specialization | None | Yes | Multi-layered |
| Suitable task scale | Small–Medium | Medium–Large | Large–Very Large |
Parallel vs. Sequential Execution
Section titled “Parallel vs. Sequential Execution”Use parallel or sequential execution based on task dependencies. Anthropic describes parallelization as a workflow where independent subtasks can run simultaneously and then be aggregated.[1]
graph LR
subgraph Parallel["Parallel Execution (no dependencies)"]
P_Start["Task Start"] --> PA["Subtask A"]
P_Start --> PB["Subtask B"]
P_Start --> PC["Subtask C"]
PA --> P_End["Integration · Done"]
PB --> P_End
PC --> P_End
end
subgraph Sequential["Sequential Execution (with dependencies)"]
S1["Step 1\nData Collection"] --> S2["Step 2\nData Analysis"]
S2 --> S3["Step 3\nReport Generation"]
S3 --> S4["Step 4\nFinal Review"]
endCases where parallel execution is appropriate
- Simultaneously scraping multiple web pages
- Independently gathering information from different data sources
- Reviewing multiple code files at the same time
Cases where sequential execution is necessary
- The result of the previous step is the input for the next step
- There are dependencies like data collection → analysis → report generation
- The next process should only run if approval is granted
Human-in-the-Loop
Section titled “Human-in-the-Loop”Human-in-the-loop (HITL) is a design pattern that requires human confirmation or approval at specific points in the agent’s processing flow.
Why It Matters
Section titled “Why It Matters”When an agent operates fully autonomously, the following risks arise:
- Mistakes in irreversible operations: File deletion, sending emails, and database updates cannot be undone
- Errors in high-risk decisions: Leaving important decisions solely to agents makes accountability unclear
- Lack of context: Agents cannot fully understand the user’s true intent or organizational policies
Implementation Pattern
Section titled “Implementation Pattern”sequenceDiagram
participant U as User
participant O as Orchestrator
participant A as Agent
participant T as Tool
U->>O: Task request
O->>A: Subtask delegation
A->>A: Planning
A->>U: Approval request (before high-risk operation)
Note over A,U: "Are you sure you want to delete these files?"
U->>A: Approved
A->>T: Tool execution
T->>A: Execution result
A->>O: Subtask complete
O->>U: Final resultExamples of operations where approval is recommended
| Risk Level | Operation Examples | Response |
|---|---|---|
| High | File deletion, email sending, payment processing | Always require human approval |
| Medium | Changes to important files, POST to external services | Show diff and confirm |
| Low | File reading, web search | Auto-execute |
Context Management Challenges
Section titled “Context Management Challenges”For long tasks or coordination among multiple agents, context management is a critical challenge.
Key Challenges
Section titled “Key Challenges”Context length limits
LLMs have a context window (the amount of text they can process at once). For long tasks, the accumulated information can exceed this window.
Information passing to sub-agents
Passing too much information from a parent to a child agent is inefficient; passing too little degrades processing quality.
Solutions
Section titled “Solutions”| Challenge | Solution |
|---|---|
| Context length overflow | Summarize important information; archive old context |
| Optimizing information passing | Use structured intermediate outputs (JSON, etc.) |
| State persistence | Save to external memory (vector DB, files) |
Conceptual Parallel Task Example
Section titled “Conceptual Parallel Task Example”The following conceptual example shows the idea of running independent tasks in parallel. If you use Claude Code subagents, check the official subagents documentation for the current configuration model.[2]
# Python (conceptual code snippet)
# Conceptual SDK-based multi-agent example
import anthropic
import asyncio
client = anthropic.Anthropic()
# The orchestrator launches multiple subtasks in parallel
async def run_parallel_agents(tasks: list[str]):
"""Run multiple sub-agents in parallel"""
# Delegate each task to an independent sub-agent
results = await asyncio.gather(*[
run_subagent(task) for task in tasks
])
return results
async def run_subagent(task: str) -> str:
"""Run a single sub-agent"""
response = await client.messages.create(
model="claude-sonnet-4-5",
max_tokens=4096,
system="You are a specialized research agent.",
messages=[{"role": "user", "content": task}]
)
return response.content[0].text
# Usage example
tasks = [
"Research the latest trends in the EV market",
"Research the market share of major players",
"Research the characteristics of the Japanese market",
]
# Three sub-agents run in parallel
results = await run_parallel_agents(tasks)Claude Code supports custom subagents defined through Markdown configuration.[2] See Framework Comparison for related framework context.
Summary
Section titled “Summary”- Orchestration is a design approach for coordinating multiple agents to accomplish tasks
- Three patterns: single agent (simple), multi-agent (specialized), hierarchical (large-scale)
- Independent tasks use parallel execution; dependent tasks use sequential execution for efficiency
- Human-in-the-loop is essential safety design for irreversible operations and high-risk decisions
- Context management (controlling length and designing information passing) is the key to practical systems
Frequently Asked Questions
Section titled “Frequently Asked Questions”Q: Does using multi-agent increase costs?
A: Yes, costs increase because the number of LLM calls grows with the number of agents. However, there are many cases where the cost-effectiveness improves through time savings from parallel execution and quality improvement from specialization. Design with the trade-off between task complexity and cost in mind.
Q: Doesn’t adding Human-in-the-loop reduce autonomy?
A: Keeping approval points to the necessary minimum is important. Design so that low-risk operations run autonomously, while only irreversible operations and high-risk decisions require confirmation. This maintains a balance between safety and autonomy.
Q: What’s the typical context window limit?
A: Context window limits vary by model and API version. Do not rely on fixed values; check the current official documentation for the model you use. For long tasks, summarization and external memory use are practically necessary.
Q: How should I decide what information to pass to a sub-agent?
A: The basic principle is to pass only the minimum information necessary for the sub-agent to complete its task. Passing the goal, constraints, and key results from the previous step in a compact, structured format (such as JSON) achieves a good balance between efficiency and accuracy.
Related Links
Section titled “Related Links”- What Is an AI Agent? — Basic agent structure
- AI Agent Framework Comparison — Implementation framework comparison
- AI Agents and MCP — Tool integration standardization
References
Section titled “References”- Anthropic, Building effective agents, December 19, 2024
- Anthropic, Create custom subagents