Short version: Routing classifies an input and hands it to the specialist best suited to it. Anthropic calls it routing, and Google calls it the coordinator or dispatcher pattern. It lets you write focused prompts for each case instead of one bloated prompt that tries to do everything.
What is routing?
Routing classifies an input and directs it to a specialized followup task (Anthropic). Google's coordinator pattern describes the same move: a central agent analyzes a request, decomposes it, and dispatches it to the specialized agent that handles that function (Google Cloud).
The reason it works is separation of concerns. Without routing, tuning a single prompt for one kind of input tends to hurt performance on the others (Anthropic). Splitting lets each specialist stay sharp.
How it actually works
A classifier sits at the front. It can be an LLM or a plain classification model, whichever labels the input accurately. The label picks the downstream prompt, tools, and even the model size.
In Google ADK this is model-driven delegation. You define a coordinator with a list of specialist sub-agents, and the framework transfers execution based on each specialist's description (Google Developers). The description field is doing real work here: it is effectively the API doc the model reads to decide where to send the request.
# Google ADK, sketch
billing = LlmAgent(name="Billing", description="Handles invoices and billing.")
tech = LlmAgent(name="TechSupport", description="Troubleshoots technical issues.")
router = LlmAgent(name="Coordinator",
instruction="Route billing issues to Billing and bugs to TechSupport.",
sub_agents=[billing, tech])
A second win: route by difficulty
Routing is not only about topic. Anthropic points out you can route easy, common questions to a small, cost-efficient model and hard, unusual ones to a larger model (Anthropic). That single decision can cut cost sharply without hurting the answers that actually need the big model.
When to use it
Use routing when your inputs fall into distinct categories that are better handled separately, and when classification can be done accurately (Anthropic). Customer service is the canonical case: general questions, refunds, and technical support each want their own prompt, tools, and process. Google frames the fit as structured business processes that need adaptive routing, like sending an order-status, return, or refund request to the right specialist (Google Cloud).
When not to use it
Skip routing when the categories are fuzzy or the classifier is unreliable. A wrong label sends the whole request down the wrong path, and the specialist has no way to know. If you cannot classify accurately, a single flexible agent may do better.
Also skip it when one prompt already handles every input well. Routing adds at least one extra decision step, so if there is nothing to separate, you are paying for structure you do not need. And note the difference from parallelization: routing picks one destination, it does not run several at once.
Known problems
The main cost is more model calls. Because the coordinator and each specialist rely on a model to reason, this pattern makes more calls than a single agent, which raises token throughput, cost, and overall latency (Google Cloud). You get higher-quality, more focused answers, but you pay for the routing step.
The second problem is misrouting. Classification is never perfect, and a confident wrong route is worse than a hedge. Weak specialist descriptions make this worse, because the model routes on those descriptions. Vague descriptions cause quiet, hard-to-trace errors.
Three things to know before you start
- Write specialist descriptions like API docs. In model-driven routing, the description is how the model decides. Be precise about what each specialist does and does not handle.
- Route by cost, not just topic. Sending easy requests to a smaller model is one of the cheapest wins in this whole catalog.
- Log the label. When an answer is wrong, the first question is whether the route was wrong. Store the classification so you can find out.
FAQ
Is routing the same as the coordinator pattern?
Yes. Anthropic's routing and Google's coordinator or dispatcher pattern both classify an input and send it to one specialist.
How is routing different from parallelization?
Routing sends an input to one path. Parallelization runs several paths at once and merges the results. Routing chooses, parallelization spreads.
Do I need an LLM to do the routing?
No. The classifier can be a traditional model or algorithm if that labels your inputs accurately. Use whatever is reliable.
What happens if the router misclassifies?
The request goes to the wrong specialist and usually fails silently. Accurate classification and clear specialist boundaries are what keep this pattern safe.
Sources
- Anthropic, Building Effective Agents: https://www.anthropic.com/engineering/building-effective-agents
- Google Developers Blog, Developer's guide to multi-agent patterns in ADK: https://developers.googleblog.com/developers-guide-to-multi-agent-patterns-in-adk/
- Google Cloud Architecture Center, Choose a design pattern for your agentic AI system: https://docs.cloud.google.com/architecture/choose-design-pattern-agentic-ai-system

Top comments (0)