|
|
ADK Agent Routing - Intent-Based Dispatch
Author: Venkata Sudhakar
As you build more specialist agents, you need a way to route incoming requests to the right one. A routing agent classifies the user intent and delegates to the appropriate specialist. ShopMax India has 6 specialist agents - orders, returns, products, payments, technical support, and promotions. A single routing agent handles all incoming queries and dispatches them correctly. The router uses a lightweight model for classification (fast and cheap) and then invokes the specialist agent. The classification step extracts intent, confidence, and any parameters the specialist needs from the original message. The below example shows how ShopMax India implements intent-based routing across their specialist agent fleet.
The routing and dispatch logic,
It gives the following output,
Q: Where is my order ORD-2024-88712?
Routed to: orders (confidence: 0.98)
A: I will look up order ORD-2024-88712 for you right away...
Q: I want to return my headphones, they are defective
Routed to: returns (confidence: 0.96)
A: I can help you with your defective headphones return...
Q: What is the best laptop under Rs 50,000?
Routed to: products (confidence: 0.99)
A: For Rs 50,000 budget I recommend the ASUS VivoBook...
For production at ShopMax India, log every routing decision to BigQuery with intent, confidence, user ID, and response time. This data shows which specialist agents are overloaded and where routing accuracy can be improved by refining the router instruction.
|
|