# Router

A first step classifies the request and sends it to the right specialist prompt or agent.

AI developers · Part 04: Agents · Card 8 of 11 · Last updated 2026-10-13

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

## Related concepts

- [Multi-agent](https://studyvisually.com/learn/tech/ai-developers/agents/multi-agent)
- [ReAct](https://studyvisually.com/learn/tech/ai-developers/agents/react-pattern)
- [Plan-and-execute](https://studyvisually.com/learn/tech/ai-developers/agents/plan-and-execute)
- [Agent](https://studyvisually.com/learn/tech/ai-developers/agents/agent)

Web page: https://studyvisually.com/learn/tech/ai-developers/agents/router-pattern
Study this card in the app: https://studyvisually.com/app/learn?category=ai-developers&card=router-pattern
