Router: Classify and Dispatch
The Router pattern classifies input in a single step and dispatches to specialized handlers — a stateless, fast alternative to supervisor-based orchestration.
Quick Reference
- →Router = one classification step → dispatch to the right handler → return result
- →Stateless: no iterative reasoning, no tool loops — classify once and route
- →Faster and cheaper than supervisor patterns because there's only one LLM call for routing
- →Implement with LangGraph conditional edges or structured output classification
- →Use when tasks are clearly separable and don't require multi-step coordination
- →Combine with specialized sub-graphs or chains for each route
What Is the Router Pattern?
Classify once → dispatch to the right handler → no iteration, no coordination
The Router pattern uses an LLM (or deterministic logic) to classify an input into one of several categories, then dispatches it to a specialized handler for that category. Unlike a supervisor, the router makes a single routing decision — it does not iterate, coordinate, or synthesize results across handlers.
Think of it as a switchboard operator: the call comes in, the operator determines the right department, and connects the caller directly. The operator doesn't listen to the conversation or coordinate between departments. This simplicity is the Router's strength — it's fast, cheap, and easy to debug.
| Aspect | Router | Supervisor | Orchestrator-Worker |
|---|---|---|---|
| LLM calls for routing | 1 | 1+ per iteration | 1+ (planning) |
| Coordination | None | Iterative | Plan-based |
| Result synthesis | None (handler returns directly) | Supervisor combines | Orchestrator combines |
| Latency | Low (single hop) | Higher (multi-turn) | Higher (plan + execute) |
| Best for | Clearly separable tasks | Tasks needing judgment | Complex multi-step tasks |