Router
A first step classifies the request and sends it to the right specialist prompt or agent.
Last updated
Analogy
An API gateway that reads the path and forwards to the right microservice.
In an agent
Routers keep each specialist small: fewer tools per prompt means better tool choices.
Practice
Flashcards
- What is a router?A step that sends a request to the right agent or prompt.
Interview questions
- Single agent or multi-agent?
- Start with one agent and good tools.
- Split into specialists only when one prompt has too many tools or responsibilities and accuracy drops.
- Multi-agent adds cost, latency and debugging complexity.
Questions people ask
What is a router in an AI agent system?
A router is a first step that classifies the request and sends it to the right specialist: a docs agent, a tickets agent, or a simple prompt. The classification can come from a small model or a structured output call. Each specialist then only needs the few tools for its own job.
Why use a router instead of one agent with every tool?
Models choose tools better from a short list. One agent with twenty tools picks wrong more often, and its prompt grows expensive. A router keeps each specialist small and focused, and a cheap model can do the routing itself. It is also easier to test each specialist on its own.