
Credits of the image to Anthropic
Overview
Routing classifies an input and directs it to a specialized follow-up task. This workflow allows for separation of concerns and building more specialized prompts. Without this workflow, optimizing for one kind of input can hurt performance on other inputs. The routing pattern works by having an initial classifier that determines what type of request or input it’s dealing with, then routes it to the appropriate specialized handler. This enables you to create highly optimized prompts for each specific scenario rather than trying to handle all cases with a single, more generic prompt.When to use
Routing works well for complex tasks where there are distinct categories that are better handled separately, and where classification can be handled accurately, either by an LLM or a more traditional classification model/algorithm.Using prompt routing in Latitude
Customer Inquiry Routing