What is routing in AI agents?
Routing is an agent design pattern in which a classifier step, either a language model or conventional code, sorts each input into a category and sends it to the prompt, tools, model or agent built for that category.
Anthropic's "Building effective agents" (December 2024) describes routing as a fit for complex tasks with distinct categories that are better handled separately, where the classification itself can be done accurately. Its examples: customer service queries split into general questions, refund requests and technical support, each with its own prompt and tools; and model routing, where easy questions go to a smaller, cheaper model and hard ones to a more capable one.
Google's guide to multi-agent patterns in ADK (December 2025) calls the same idea a coordinator or dispatcher: a central agent reads the intent and passes the request to the specialist whose description matches.
Where the routing decision can live
Code
Rules or a conventional classifier. Fast, cheap and predictable, but limited to categories it was built for.
A model call
A short classification prompt with a fixed list of labels. Handles messy language, at the cost of one extra call.
Agent descriptions
In ADK, the coordinator transfers to the sub-agent whose description fits, so the descriptions become the routing logic.
Handoff tools
In the OpenAI Agents SDK, a triage agent hands off to specialists through tools, so routing is a tool choice.
Model routing
The same request type goes to a different model depending on difficulty, to trade cost against capability.
Why routing matters
Routing keeps each branch's prompt short and its tool list narrow, which helps accuracy, and lets each branch be tested and improved on its own. It is also a cost lever: Google's post on ADK 2.0 (July 2026) reported that moving routing out of the model into deterministic graph nodes cut tokens by about 50% and latency by about 20% in its refund example, and limited what a prompt injection could change.
Making routing reliable
Label a test set
Real inputs with the correct route, including the ambiguous ones, measured on every prompt or model change.
Give it a way out
An "other" or "unclear" route that asks a question or reaches a person, rather than forcing a guess.
Write descriptions as routing logic
When agents or skills are chosen by description, short and specific descriptions with examples of what does not belong route more accurately.
Log misroutes
Every correction becomes a new test case.
How Motiontic's engineers apply it
Motiontic's engineers put routing in code wherever the categories are stable, and use a model only for the inputs code cannot sort. The router gets its own eval set before any branch is built, because a wrong route makes every later step wrong.
Routing in code compared with routing by a model
| Routing in code | Routing by a model | |
|---|---|---|
| Handles | Structured or keyword-clear inputs | Free text, mixed intents and unusual phrasing |
| Cost per input | Close to zero | One model call |
| Behaviour | Deterministic | Probabilistic, needs evals |
| Changing categories | A code change | A prompt or description change |
| Exposure to prompt injection | None | Possible, since the input reaches the model |
Common questions
What is the difference between routing and a handoff?
Routing usually decides the branch once, at the start. A handoff can happen mid-conversation, when the agent holding the conversation passes it to another agent.
What is a model router?
A model router sends each request to a different language model depending on difficulty or type, such as a small, cheap model for simple questions and a more capable one for hard ones.
How is an agent router tested?
With a labelled set of real inputs and their correct routes, scored for accuracy on every change. Ambiguous and out-of-scope inputs belong in the set, not just the clean ones.
Related
Agentic workflow
Model calls on a path set in code: predictable, cheaper and easier to test than a free-running agent.
Agent handoff
One agent passes the conversation to another, which carries on from there.
Prompt chaining
A fixed sequence of model calls, each one easier than the whole task, with checks in between.
Customer service agents
Support agents that look up, act and escalate inside Zendesk, Intercom and the systems behind them.
AI agent development
Agents that do real work for users, with the evals, traces and guardrails to keep them in production.
Running agents that have to hold up?
Describe the agent, the systems it touches and what it must never get wrong. The first call is with a lab engineer, who will say plainly whether it is ready for production, and whether Motiontic is the right team.