Context Routing
Design information flow so each participant receives exactly what it needs.
Context
Once agents collaborate, context (conversation history, user intent, intermediate results) must move between them. Forwarding everything to everyone pollutes judgment with irrelevant signal; forwarding too little prevents correct decisions.
Problem
Without routing rules, agents either lean on information outside their responsibility or miss what they need. Context overload raises token cost and degrades quality; context starvation produces re-question loops.
Forces
- Forwarding the minimum is efficient, but exceptional cases may starve.
- Structured context is easy to parse but hard to use for unstructured signal.
- Caching context improves performance but stale data can cause wrong decisions.
Solution
For each agent, declare explicitly which context items its responsibility requires. At handoff, filter and structure context against the question "what does this agent need to know right now." Summarize or drop unnecessary history; refuse the handoff if a required item is missing. Anthropic's [Effective Context Engineering for AI Agents] explains that LLMs have an "attention budget" — as tokens grow, the n² pairwise relationships dilute and "context rot" sets in. The governing principle is therefore "find the smallest high-signal token set that maximizes the desired outcome." Apply progressive disclosure: do not load everything at once; navigate the category structure and pull only what's needed.
Judgment question
What must this agent not be unaware of right now?
Application scenario
Illustrative scenario — figures and company names in this page are hypothetical for explaining the pattern, not measured data.
When the Intake Agent finishes classifying and hands off to the Response Agent, forwarding all 30 turns of history triples the token cost and lowers quality. Instead, pass a structured context: { category: 'shipping delay', customerSentiment: 'frustrated', keyFacts: ['order A-1234', 'expected ship date +3 days'], priorResolutionAttempts: [] }. The Escalation Agent, by contrast, needs sentiment scoring and the full escalation history to decide correctly. Each agent's context requirement is different.
How it breaks
Forwarding the full conversation history to every agent makes the Response Agent overreact to the customer's old complaints and offer unnecessary compensation, and inflates the QA Agent's false-positive rate because it now evaluates intermediate reasoning. Context pollution lowers quality quietly, which makes the root cause hard to find.
Implementation pattern bridge
- Sequential Pipeline
- Routing Pattern
At each pipeline step, rules filter and structure the context passed to the next agent. The Routing Pattern branches inquiries to the appropriate agent based on type.
Academic References
- The Rise of Agentic AI: Architectures, Taxonomies, and Evaluation Metrics — Future Internet (MDPI)