Routing
Classify each input, then send it to the prompt, model or agent built for that kind.
Also called Dispatcher
Anthropic, LinkedIn, Amazon Web Services, LangChain
The problem
A prompt tuned for one kind of input does worse on the others.
Without this workflow, optimizing for one kind of input can hurt performance on other inputs.
The Routing workflow is used in scenarios where an agent must quickly classify input intent, task type, or domain, and then delegate the request to a specialized subagent, tool, or workflow.
Therefore
Routing classifies an input and directs it to a specialized followup task. This workflow allows for separation of concerns, and building more specialized prompts.
In the routing pattern, a classifier or router agent uses an LLM to interpret the intent or category of a query, then routes the input to a specialized downstream task or agent.
Routing workflows process inputs and then directs them to context-specific tasks. This allows you to define specialized flows for complex tasks.
In use
Our system takes your question and decides which AI agent is best equipped to handle it.
Lyft, in its guest post on LangChain’s blog
Our system follows LangGraph's router multi-agent architecture. A meta agent acts as a stateful router: it classifies the incoming request and uses Command(goto=...) to dispatch to the appropriate specialized subagent.
Where it breaks
Answers to one user can come from different models, prompts or tools, and feel inconsistent.
Maintaining a uniform user experience became challenging when subsequent interactions with an assistant might be managed by varied models, prompts, or tools.
Sources
- Building effective AI agentsAnthropic, Dec 19, 2024
- Musings on Building a Generative AI ProductJuan Pablo Bottaro, Karthik R., LinkedIn, Apr 25, 2024
- Workflow for routingAmazon Web Services
A first-pass LLM acts as a dispatcher
- Workflows and agentsLangChain
- How Lyft Built a Self-Serve AI Agent Platform with LangGraph and LangSmithAkshay Sharma (Lyft), LangChain, May 27, 2026
Added Nov 14, 2026
