>_TheQuery
← Glossary

Query Routing

Information Retrieval

The process of classifying a user query and directing it to the most appropriate retrieval strategy, such as knowledge graph lookup, RAG search, or hybrid retrieval.

Query routing is the process of analyzing a user query to determine which retrieval strategy will produce the best answer. In hybrid RAG+KG systems, queries can be routed to: knowledge graph direct lookup (for factual queries like "Who is the CEO?"), KG traversal (for relationship queries like "Who reports to Alice?"), RAG-heavy retrieval (for analytical queries requiring document analysis), or full hybrid retrieval (for complex queries needing both structured and unstructured knowledge).

Query routing is typically implemented using an LLM classifier that categorizes queries into types such as FACTUAL, RELATIONAL, MULTI_HOP, ANALYTICAL, or HYBRID, along with a confidence score. The router then directs each query type to the appropriate retrieval strategy, adjusting the balance between KG and RAG components.

Effective query routing is a key differentiator of production hybrid systems. Without routing, every query hits both the knowledge graph and vector database, increasing latency and cost while potentially degrading quality (irrelevant KG results can confuse the LLM). With routing, the system applies the right tool for each query type, achieving both better quality and lower latency.

Last updated: February 22, 2026