---
title: "Routing pattern for AI agents | Agentic Pattern Language"
description: "Classify each input, then send it to the prompt, model or agent built for that kind. Sourced from Anthropic, LinkedIn, and Amazon Web Services."
url: https://agenticpatternlanguage.com/patterns/routing/
---

4 [Systems of agents](https://agenticpatternlanguage.com/#systems-of-agents)

# Routing

Classify each input, then send it to the prompt, model or agent built for that kind.

Also called Dispatcher

![](https://agenticpatternlanguage.com/_astro/linkedin.com.DoopF6s3_Z2tjgb3.webp) Anthropic, LinkedIn, Amazon Web Services, LangChain

[How to read this](https://agenticpatternlanguage.com/notation/)

## Alternatives

* [Handoff](https://agenticpatternlanguage.com/patterns/handoff/)
* [LLM cascade](https://agenticpatternlanguage.com/patterns/llm-cascade/)

## 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.

Anthropic [Building effective AI agents](https://www.anthropic.com/engineering/building-effective-agents) Dec 19, 2024

> 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.

Amazon Web Services [Workflow for routing](https://docs.aws.amazon.com/prescriptive-guidance/latest/agentic-ai-patterns/workflow-for-routing.html)

## 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.

Anthropic [Building effective AI agents](https://www.anthropic.com/engineering/building-effective-agents) Dec 19, 2024

> 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.

Amazon Web Services [Workflow for routing](https://docs.aws.amazon.com/prescriptive-guidance/latest/agentic-ai-patterns/workflow-for-routing.html)

> Routing workflows process inputs and then directs them to context-specific tasks. This allows you to define specialized flows for complex tasks.

LangChain [Workflows and agents](https://docs.langchain.com/oss/python/langgraph/workflows-agents)

## In use

LinkedIn

> Our system takes your question and decides which AI agent is best equipped to handle it.

![](https://agenticpatternlanguage.com/_astro/linkedin.com.DoopF6s3_1EOmO9.webp) LinkedIn [Musings on Building a Generative AI Product](https://www.linkedin.com/blog/engineering/generative-ai/musings-on-building-a-generative-ai-product) Apr 25, 2024

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.

LangChain [How Lyft Built a Self-Serve AI Agent Platform with LangGraph and LangSmith](https://langchain.com/blog/lyft-built-a-self-serve-ai-agent-platform-for-customer-support-with-langgraph-and-langsmith) May 27, 2026

## 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.

![](https://agenticpatternlanguage.com/_astro/linkedin.com.DoopF6s3_1EOmO9.webp) LinkedIn [Musings on Building a Generative AI Product](https://www.linkedin.com/blog/engineering/generative-ai/musings-on-building-a-generative-ai-product) Apr 25, 2024

## Sources

1. [Building effective AI agents](https://www.anthropic.com/engineering/building-effective-agents) Anthropic, Dec 19, 2024
2. [Musings on Building a Generative AI Product](https://www.linkedin.com/blog/engineering/generative-ai/musings-on-building-a-generative-ai-product) Juan Pablo Bottaro, Karthik R., LinkedIn, Apr 25, 2024
3. [Workflow for routing](https://docs.aws.amazon.com/prescriptive-guidance/latest/agentic-ai-patterns/workflow-for-routing.html) Amazon Web Services
   > A first-pass LLM acts as a dispatcher
4. [Workflows and agents](https://docs.langchain.com/oss/python/langgraph/workflows-agents) LangChain
5. [How Lyft Built a Self-Serve AI Agent Platform with LangGraph and LangSmith](https://langchain.com/blog/lyft-built-a-self-serve-ai-agent-platform-for-customer-support-with-langgraph-and-langsmith) Akshay Sharma (Lyft), LangChain, May 27, 2026

Added Nov 14, 2026
