A team building a customer-support system feeds every incoming user message into a single LLM call that first classifies whether the message is a billing question, a technical support question, or a general inquiry, and then, based on that classification, forwards the message to a separate, specialized prompt written specifically for that category. Which Anthropic 'Building Effective Agents' workflow pattern does this describe, and why is it a good fit here?
- Routing -- classifying the input and directing it to a specialized downstream prompt, which fits because the three query types are reliably distinguishable and each benefits from a prompt written specifically for it, avoiding one generalized prompt trying to handle every case well
- Prompt chaining -- decomposing a task into a fixed sequence of subtasks that always run one after another, which fits because every support message needs the same sequence of steps regardless of category
- Evaluator-optimizer -- having a second LLM call critique and iteratively improve the first call's output, which fits because the classification itself needs repeated revision before it is trusted
- Orchestrator-workers -- a lead LLM call dynamically deciding how many parallel worker calls a task needs, which fits because the number of specialized prompts required varies from message to message
Why A? And why not the others?
Correct answer: A. Routing -- classifying the input and directing it to a specialized downstream prompt, which fits because the three query types are reliably distinguishable and each benefits from a prompt written specifically for it, avoiding one generalized prompt trying to handle every case well
This is routing: classifying an input and directing it to a specialized downstream prompt built for that category, rather than handling every case with one generalized prompt. It fits here because billing, technical, and general inquiries are distinct, reliably classifiable categories that each benefit from separation of concerns -- a prompt tuned for billing questions can be narrower and more accurate than one that also has to handle technical troubleshooting. The option describing a fixed sequence of subtasks that always runs in the same order regardless of category is wrong because nothing here chains multiple sequential steps; a single classification step chooses one path, it doesn't sequence several. The option describing a second call critiquing and revising the first call's output is wrong because no critique-and-revise loop exists here -- the classification's output is acted on directly, not evaluated and iterated on afterward. The option describing a lead call dynamically spinning up a varying number of parallel workers is wrong because this scenario routes to exactly one specialized prompt per message, not to multiple concurrent workers coordinated by a lead call.
Source: Anthropic, 'Building Effective Agents' (anthropic.com/engineering/building-effective-agents) -- describes routing as classifying an input and directing it to a specialized followup task, suited to tasks with distinct categories that are better handled separately and where classification can be handled accurately.