Routing (agent pattern)
Definition
A workflow pattern where a first step classifies the input and sends it on to a specialised prompt, tool or model for that type.
In more detail
A support assistant might classify each message as billing, technical or refund and pass it to a prompt written for that case. The classifier can be a small model, a larger model or ordinary code.
Routing keeps each downstream prompt focused, which usually beats one prompt that tries to cover everything. It also lets you send easy categories to a cheaper model, which is where it overlaps with model routing for cost. Evaluate the classifier on its own, because a wrong route means every later step works on the wrong problem.
Related terms
Agentic workflow
A mostly predefined sequence of LLM calls and tool steps, where the developer fixes the path and the model fills in each step.
Model routing
Choosing which model handles each request, often sending easy requests to a small, cheap model and hard ones to a larger model.
Prompt chaining
Splitting a task into a fixed sequence of model calls where each call works on the output of the previous one, with checks in between.
Handoff (agents)
A transfer of control between agents: one agent passes the conversation and its history to another, which carries on with the user.
Orchestrator-workers
A pattern where one model breaks a task into subtasks at run time, hands each to a worker model, and combines the results.
Parallelisation (agent pattern)
A workflow pattern that runs several model calls at once, on parts or copies of one task, and combines their outputs in code.
Read more about Routing (agent pattern)
- Workflows vs agents: start with the simplest thing that works
Most LLM features should be a fixed workflow, not an agent. How to tell which one you need, when an agent earns its cost, and the useful patterns in between.
- AI agents
Building systems where models plan and call tools in a loop to complete tasks.
- Model routing
Choosing which model handles each request, often sending easy requests to a small, cheap model and hard ones to a larger model.