Agent Architecture/Workflow Patterns
Intermediate9 min

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?

User QueryClassify1 LLM callTechnicalHandlerBillingHandlerGeneralHandler1 hop onlyNo iteration

Classify once → dispatch to the right handler → no iteration, no coordination

Definition

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.

AspectRouterSupervisorOrchestrator-Worker
LLM calls for routing11+ per iteration1+ (planning)
CoordinationNoneIterativePlan-based
Result synthesisNone (handler returns directly)Supervisor combinesOrchestrator combines
LatencyLow (single hop)Higher (multi-turn)Higher (plan + execute)
Best forClearly separable tasksTasks needing judgmentComplex multi-step tasks