AI Glossary / Prompting and human-AI interaction / Intermediate
Prompt routing
Definition
Prompt routing is the practice of sending each incoming request to the most suitable prompt, model or workflow, instead of handling every request the same way. A router looks at the request, picks a path, and passes the work along. It is not the same as load balancing, which spreads traffic for speed. Some teams also use the phrase for choosing between models only.
What it means
Most AI tools start with one prompt that tries to do everything. That prompt grows long and brittle as new request types are added. Prompt routing splits the job. A small first step decides what kind of request has arrived. Then a prompt written for that kind of request does the real work.
The benefit is focus. A prompt for refund questions can carry refund policy and a refund tone. A prompt for technical questions can carry product documentation. Each one stays short, is easier to test, and is easier to fix when something goes wrong. Routing can also control cost, because simple requests can go to a smaller, cheaper model while hard ones go to a stronger model.
How it works
A router has three parts: a way to classify the request, a set of routes, and a rule for what happens when nothing fits. The classifier can be a language model given a short instruction and a list of categories. It can be keyword rules, a small trained classification model, or a mix. Many teams start with rules and add a model for the unclear cases.
Each route points to a destination. The destination might be a specialized prompt, a different model, a lookup in a database, a tool call, or a human queue. The router returns a label, the system maps the label to the destination, and the chosen path produces the answer. Anthropic's guide to building effective agents describes routing as a common workflow pattern for this reason: it separates concerns so each path can be tuned on its own.
A good router always has a fallback. If confidence is low or the request fits no category, it should go to a general prompt or a person, not guess. Teams usually log the label chosen for every request, so misrouted cases can be reviewed and the rules or instructions improved over time.
Three practical examples
- Finance team: An internal assistant receives questions about expense policy, invoice status and month-end close. The router labels each question and sends it to a prompt loaded with the right policy text. Questions it cannot label go to the finance operations inbox.
- Retailer: A shop's chat widget gets order tracking, returns, product advice and complaints. Order tracking goes to a tool that reads the order system. Complaints go to a human agent with a summary. Product advice goes to a prompt that uses the catalog.
- Support desk: A software company routes simple how-to questions to a small, inexpensive model and sends bug reports with logs to a stronger model. The desk compares answer quality and cost for each route each month.
Think of it this way
Think of the front desk at a clinic. The receptionist asks a few questions and sends you to the nurse, the doctor or the billing office instead of making one person handle everything. The analogy stops working where the receptionist is a person who knows when to say they are unsure; a router must be explicitly built with a fallback or it will simply pick the closest label.
Worked example
A help desk handles 2,000 requests a month. A single large model handles all of them at an average of $0.050 per request, so the monthly cost is 2,000 x $0.050 = $100.
After review, the team finds 70 percent are simple how-to questions. They add a router. The router itself costs $0.002 per request, so routing 2,000 requests costs 2,000 x $0.002 = $4. Simple questions, 70 percent of 2,000 = 1,400 requests, go to a small model at $0.010 each: 1,400 x $0.010 = $14. The remaining 600 requests go to the large model at $0.050 each: 600 x $0.050 = $30.
New monthly cost is $4 + $14 + $30 = $48, down from $100. The saving of $52 only counts if quality holds, so the team samples 100 simple answers each month and checks them against the old results.
Illustrative case study
Fictional case: Harbor Lane Supply, a made-up distributor of cleaning products, built one long prompt for its customer email assistant. It covered orders, returns, safety data sheets and pricing. Answers on safety questions were sometimes vague because the prompt was crowded with unrelated rules.
The team added a router with five labels and a sixth called other. Safety data questions went to a prompt that quoted only the approved sheets and refused to improvise. Early on, the router sent a returns question mentioning a chemical spill to the returns route, and the customer got a cheerful return form instead of safety guidance.
The team reviewed the logs, saw the pattern, and added a rule that any message containing words about spills, exposure or injury goes straight to a human. They also lowered the confidence needed to send a message to the other queue. Misroutes dropped in the following review, and the safety prompt stayed short enough to test.
Common misconceptions and mistakes
Routing always saves money. It saves money only when a meaningful share of requests can be handled well by a cheaper path, and the router itself adds cost and a chance of error.
The router needs to be a large model. Often a few clear rules or a small classifier do the job well, and a model is added only for the ambiguous cases.
Once set up, routing can run unattended. Request types change over time, so labels, rules and instructions need regular review against logged cases.
Routing is the same as an AI agent. A router picks one path and hands off, while an agent plans and takes several steps by itself; the two can be combined but they are different ideas.
Business use
To start, collect a few hundred real requests and sort them by hand into a small number of categories. Write a short prompt or rule set that reproduces your labeling, and test it on requests you set aside. Begin with three to six routes plus a fallback. Keep the first version simple, and add routes only when logs show a real need.
Measure routing accuracy against your hand labels, answer quality for each route, cost per request, response time and the share sent to the fallback or to a human. Risks include confident misrouting, hidden bias in how categories are defined, and harder debugging because a failure may sit in the router or in the destination. Record every routing decision so you can trace problems, and keep a person in the loop for sensitive categories such as safety, legal or complaints.
People also ask
Is prompt routing the same as model routing?
Model routing is one kind of prompt routing, where the choice is which model answers. Prompt routing is wider and also covers choosing between prompts, tools, data sources or human queues.
Do I need code to use prompt routing?
Some no-code automation tools let you add a classification step and branch on its result. More complex setups, with logging and testing, usually need a developer.
What happens if the router picks the wrong route?
The user gets an answer from a prompt not built for their question, which can be vague or wrong. A fallback route, a confidence threshold and regular review of logs reduce the damage.
Check your understanding
In the worked example, what is the monthly cost after routing?
Answer: $48, made up of $4 for the router, $14 for the small model and $30 for the large model.
Why does every router need a fallback?
Answer: Some requests fit no category or are unclear. Without a fallback the router would force a poor match, so low-confidence cases should go to a general prompt or a person.
What went wrong in the Harbor Lane case and how was it fixed?
Answer: A spill-related message was sent to the returns route. The team added a rule sending spill, exposure and injury words to a human and adjusted the fallback threshold.
Why is routing accuracy measured against hand labels?
Answer: Hand labels give a trusted answer for each sample request, so you can count how often the router picks the same route and spot weak categories.
Related terms
- Prompt chaining
- System prompt
- Classification
- Guardrails
- Human-in-the-loop
- AI agent
- Prompt template
- Fallback
Learn next
Try the exercise in the business use section: sort 100 of your own requests into categories and see which categories are clear and which blur together. Then read about prompt chaining, which links steps in sequence, and guardrails, which limit what each route is allowed to do.
More in Prompting and human-AI interaction
- Prefill
- Presence penalty - A presence penalty is a text generation setting that lowers the chance of a language model using any token that has already appeared in the output, no...
- Prompt - A prompt is input supplied to a generative AI model to guide the output it produces.
- Prompt-based learning - Prompt-based learning uses prompts to guide a pretrained model toward a task or desired behavior.
- Prompt engineering - Prompt engineering is the deliberate design and testing of instructions given to an AI model.
- Prompt framework - A prompt framework is a named structure, often an acronym, that tells a person which parts to include when writing a prompt, such as role, task, context...
Sources
Anthropic, Building effective agents: https://www.anthropic.com/engineering/building-effective-agents OpenAI, Prompt engineering guide: https://platform.openai.com/docs/guides/prompt-engineering DAIR.AI, Prompt Engineering Guide: https://www.promptingguide.ai/ The sources were consulted for how routing is described as a workflow pattern and for general prompting practice; the examples, analogy, worked example and case are original educational illustrations. Checked 5 Nov 2026.
Previous: Prompt pattern Next: Prompt scaffolding