Pattern · intermediate
Routing and Handoffs Pattern
Routing patterns send tasks to the right agent, model, or workflow based on intent, risk, and skills.
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.
FAQ
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.