Sub-agent Context Passing
Authoritative Definition
Protocols and message schemas for transferring task state, memory slices, and execution objectives between parent orchestrators and specialized child agents.
Overview & Technical Description
Sub-agent context passing is a critical architectural pattern in multi-agent systems, enabling hierarchical delegation of tasks without overwhelming the context windows of individual agents. When a primary orchestrator agent decomposes a complex user request, it spawns specialized sub-agents. To ensure these sub-agents operate effectively, the orchestrator must selectively pass down the relevant task boundaries, state, and historical context required for the specific sub-task. This process requires strict message schemas and protocols. A sub-agent does not need the entire conversation history; instead, it requires a precise objective, a slice of relevant working memory, and potentially a set of tools specific to its domain. The context passing mechanism packages these elements, often employing standard formats or system prompts dynamically injected at runtime. Once the sub-agent completes its execution, a reverse context passing step occurs, synthesizing the output back to the parent agent while discarding intermediate scratchpad reasoning. Efficient context passing mitigates the risk of "context window pollution," where irrelevant information degrades model reasoning and increases latency or cost. Frameworks like AutoGen, LangGraph, and specialized Model Context Protocols (MCP) standardize these interactions, allowing distributed agent topologies to maintain high coherence. It forms the backbone of scalable AI infrastructure where diverse models handle highly segregated workflows.
Editorial Notes
A common anti-pattern is passing full conversation logs to child agents, which quickly exhausts token limits and degrades reasoning quality. Always sanitize and summarize state before delegation.