Pattern · intermediate
Routing and Handoffs Pattern
Routing patterns send tasks to the right agent, model, or workflow based on intent, risk, and skills.
- routing
- multi-agent
- architecture
Routing and handoffs decide who should handle a task—and when control should move.
Why routing matters
Not every request needs your most expensive agent. A good router:
- Sends FAQ to RAG chat
- Sends refunds to a policy workflow
- Sends ambiguous investigations to a deep agent
- Escalates abuse/safety cases
Router designs
- Rules first — keywords, customer tier, intent classifiers
- Model router — LLM chooses a destination from an enum
- Hybrid — rules for safety, model for nuance
Handoff payload
Always pass:
- Goal and constraints
- Normalized state
- What already failed
- Confidence / risk flags
Failure modes
- Router thrash (A→B→A)
- Losing context on handoff
- Routing to agents lacking tools
Evaluation
Measure misroute rate, average cost by class, and time-to-resolution vs a single default agent.
Frequently asked questions
What is agent routing?
Routing is the decision layer that sends a request to the best specialist agent, model, or deterministic workflow based on intent, risk, and capabilities.
Related reading
Multi-Agent Pattern
Multi-agent systems split work across specialized agents with defined roles, handoffs, and shared state.
Agent Cost Control: Budgets, Caching, and Model Routing
How to control token and tool spend in agentic systems without destroying task success rates.
Agentic Architecture: Core Components of Production Agents
A practical architecture model for agentic systems: goals, planners, tools, memory, orchestration, evals, and control planes.