2.3 Multi-Agent Orchestrator & Subagent Decomposition
Key Takeaways
Justify multi-agent orchestration by concrete structural needs—context-window isolation, parallel open-ended exploration, or distinct tool/security boundaries—not organizational mimicry
Tightly coupled edits with dense shared state may lose information and incur coordination overhead across agents; benchmark multi-agent designs against simpler alternatives.
Enforce context isolation by passing explicit scoped context packets to subagents and returning schema-validated summaries plus source IDs instead of raw tool logs
Use bounded retries, deadlines, failure policies, distributed traces, and verified source identifiers; identifiers support auditability but do not establish factual entailment.
Multi-Agent Orchestrator & Subagent Decomposition
In a multi-agent orchestrator-worker architecture, a lead orchestrator agent decomposes an overarching goal, delegates subtasks to specialized subagents, validates returned artifacts, and synthesizes the final response. While powerful for broad research and cross-system analysis, multi-agent systems can consume considerably more tokens and introduce coordination overhead compared with single-agent or deterministic workflow designs.
When Multi-Agent Decomposition Is Justified vs. Overkill
| Dimension | Multi-Agent Justified | Harmful Overkill (Use Single Agent or Workflow) |
|---|---|---|
| Context Pressure | Broad parallel search across 5 to 10 large sources could crowd one context window with raw search results | Input and reasoning fit a single tested context budget |
| Task Coupling | Subtasks explore independent hypotheses or domains (financial, legal, technical due diligence) | Tightly coupled steps sharing dense mutable state (such as iterative multi-file code editing) |
| Security & Tool Isolation | Distinct privilege zones required (read-only web researcher vs. sandboxed code runner vs. zero-tool compliance checker) | All steps share the same low-risk read-only toolset and user identity |
| Latency & Cost SLA | Asynchronous reports or workloads that justify parallel exploration | Interactive tasks whose latency and cost limits a multi-agent prototype misses |
Critical Anti-Pattern: Mirroring human org charts (creating separate "Manager," "Writer," "Editor," and "QA" agents for a straightforward two-page memo) introduces telephone-game information loss without improving quality. Always compare a multi-agent prototype against a well-prompted Prompt Chain on the same golden test set.
Control Flow and Context Isolation
The decisive engineering advantage of orchestrator-worker decomposition is context isolation. When a single agent performs twenty web searches or inspects dozens of large database payloads, raw HTML, stack traces, and dead-end queries accumulate in its context window, degrading reasoning accuracy.
To prevent context pollution, structure communication through explicit contracts:
- Orchestrator Responsibilities: Maintain the global plan, track task dependencies, allocate per-subagent step and token budgets, validate subagent outputs, and perform final cross-source synthesis.
- Scoped Context Packets (Inbound): Pass only the context a worker needs, including relevant upstream decisions. Pass a lean packet containing: task objective, target scope/entities, enforced scope and tool allowlist, budget limits (such as turn count and timeout), and strict output schema.
- Distilled Artifacts (Outbound): Require each subagent to return a compact, schema-validated JSON payload containing structured findings, confidence flags, and immutable source references—keeping irrelevant intermediate data out of the synthesis context.
- No Uncoordinated Peer Chatter: Route control back through the orchestrator or an explicit state machine rather than allowing arbitrary peer-to-peer messaging loops among workers.
Error Recovery and Partial Failure
When an orchestrator fans out to four subagents, partial failure is a normal operating condition rather than an edge case. One subagent may hit an upstream API 429 rate limit, exceed its timeout, or emit malformed output. Resilient orchestration enforces five controls:
- Nested Timeout and Recursion Budgets: Pair an overall request SLA (for example, 45 seconds) with tighter per-subagent deadlines (for example, 25 seconds), and enforce a runtime- or application-level spawning-depth limit (such as one or two levels) so subagents cannot recursively spawn unbounded trees.
- Idempotent Retries with Backoff: For transient rate limiting (HTTP 429), overload (HTTP 529), or network failures, use bounded retries with exponential backoff and jitter, honoring Retry-After when provided. A persistent spend-cap or authorization failure requires a different response. For side-effecting operations, use a stable operation identifier and server-side deduplication or reconciliation before replay; an idempotency key helps only if the target enforces it.
- Deterministic Pre-Synthesis Validation: Validate every worker response against a strict application-defined schema before synthesis. Reject or repair malformed structures programmatically rather than letting broken output corrupt final synthesis.
- Critical vs. Enrichment Failure Policies: Classify each subagent dependency explicitly:
- Critical / Fail-Closed: If a mandatory policy-checking branch fails after retries, halt automated release and escalate to a human queue.
- Enrichment / Graceful Degradation: If a supplementary market-news subagent times out, synthesize the verified core report and surface an explicit partial-coverage notice.
- Budget Circuit Breakers: Track cumulative tokens and dollar spend per
<trace_id>, stopping new calls near budget exhaustion and returning explicitly incomplete evidence or escalating, according to criticality.
Worked Example: Due-Diligence Orchestrator Budget Math
Consider a hypothetical, measured-in-test enterprise M&A due-diligence assistant analyzing four independent data rooms (financial statements, vendor contracts, SOC 2 security audits, and litigation dockets). Running everything inside one sequential agent pushes 180,000 tokens of raw extracts into one window and takes 110 seconds. Instead, an orchestrator spawns four isolated read-only subagents concurrently, each limited by the application to 25 seconds, six turns, and at most 2,000 tokens of structured findings. If the four branches actually run concurrently and synthesis takes 7 seconds, the illustrative critical path is roughly 32 seconds (25 s slowest branch + 7 s validated synthesis), while the orchestrator only reasons over at most 8,000 returned finding tokens, plus its own prompt and overhead.
Observability and End-to-End Provenance
Debugging multi-agent failures without structured tracing is nearly impossible because errors propagate across model boundaries.
- Distributed Trace Propagation: Create a root trace at request ingress and propagate trace context across service boundaries (for example, using OpenTelemetry-compatible context propagation); create child spans for model, worker and tool operations. Record model version, input/output token counts, cache hits, latency, stop reason, and validation errors per span as appropriate, avoiding sensitive payloads and respecting retention policies.
- Immutable Source Provenance: Require every factual claim returned by a subagent to carry a verifiable
<source_id>(document ID, chunk offset, URL, and timestamp) observed directly in that worker's tool output. Run a deterministic check confirming that citations cited in the orchestrator's final synthesis appear in the validated worker evidence set—so missing or unrecognized citations can be rejected. A valid source identifier is not proof that the cited passage supports the claim; evidence entailment also needs review or evaluation..
Exam Trap: Allowing the orchestrator to rewrite or summarize subagent prose without preserving structured <source_id> bindings strips auditability in regulated industries. Likewise, letting a failing optional subagent silently disappear without flagging incomplete coverage misleads downstream decision-makers.
Primary references
During a multi-source competitive intelligence task, a single Claude agent's accuracy drops sharply after executing 18 searches that dump 140,000 tokens of raw web text into its history. Which redesign addresses the accumulating irrelevant context?
Pass the orchestrator's full 140,000-token history into four subagents so every worker sees all raw pages
Allow subagents to chat directly with each other in a shared transcript until they agree on an answer
Assign independent research scopes, retain provenance, and return compact validated findings rather than every intermediate result.
Increase the orchestrator's temperature setting so it skips older search passages during synthesis
An engineering team proposes splitting a tightly coupled Python refactoring task—where editing a database model requires simultaneously updating five dependent API serializers and unit tests—into four separate autonomous agents (Planner, Coder, Reviewer, Test Runner). Why is this likely harmful overkill?
Python code cannot be analyzed by Claude models without specialized fine-tuning
Orchestrator-worker systems forbid running deterministic pytest checks
Subagents cannot read files from the same repository directory
Dense shared state makes handoffs expensive and increases the risk of inconsistent edits compared with a single coordinated workflow using deterministic test feedback.
In an enterprise vendor-onboarding orchestrator, Subagent A runs mandatory sanctions screening and Subagent B gathers optional public sustainability news. If Subagent A fails after retries while Subagent B succeeds, what is the correct recovery behavior?
Fail closed on the critical sanctions check and escalate the onboarding case to a compliance officer rather than auto-approving
Proceed with automated vendor approval while noting that sanctions screening was skipped
Allow Subagent B to perform sanctions screening using its sustainability news search tool
Ignore the timeout and recursively spawn five deeper subagents without a recursion limit
A regulated financial institution requires full auditability showing which original document chunk supported every claim in an executive brief synthesized by an orchestrator from three specialist subagents. Which mechanism best supports verifiable end-to-end provenance?
Instructing the orchestrator in natural language to mention document titles at the bottom of the brief
Trace each execution step and link claims to versioned retrieved source IDs, validate those IDs against the evidence, and check that the passages support the claims.
Storing only the final synthesized brief in logs to minimize storage costs
Allowing the orchestrator to paraphrase all facts without retaining worker metadata
Sections you finish are checked off in the contents.