Intent Classification and Routing Strategies
Why Intent Matters for Routing
Different intents need different retrieval strategies. Navigational queries ("facebook login") should return one authoritative result fast. Informational queries ("how does photosynthesis work") need diverse, comprehensive results. Transactional queries ("buy iphone 15") should prioritize product pages with prices. Routing to the wrong backend wastes compute and frustrates users. A product search query hitting a general web index returns blog posts instead of purchasable items.
Classification Approaches
Rule-based: Pattern matching on keywords ("buy", "price", "how to"). Fast, interpretable, but brittle. Traditional ML: Logistic regression or SVM on n-gram features. Requires labeled data, handles more patterns. Neural: Fine-tuned BERT or distilled models. Best accuracy (90-95%), but higher latency (10-50ms). Production often uses cascades: fast rules filter obvious cases, ML handles ambiguous ones.
Multi-Intent Queries
"Best restaurants near me with outdoor seating" has both informational (what restaurants exist) and transactional (I want to book) aspects. Handle with: multi-label classification (predict all applicable intents), hierarchical intents (primary + secondary), or intent scores (probability per intent). The UI can then blend results from multiple backends based on intent weights.