Retrieval Routing: Beyond One-Size-Fits-All RAG

Route each question to BM25, dense, graph, structured data, or no retrieval at all.

0/4 done

Theory

Retrieval is a routing decision

RAG is not one algorithm and it is not the right first move for every question. A production system should classify the information need, select a retriever, and record why that route was chosen. Treating every query as dense top-k search hides exact matches, relationships, and authoritative structured values.

Query signalPrimary routeWhy
IDs, error codes, quoted phrases, rare namesBM25 / lexicalExact tokens carry the meaning
Paraphrase or conceptual similarityDense vectorMeaning matters more than wording
Entity relationships or multi-hop pathsKnowledge graph / GraphRAGThe answer is in edges and paths
Counts, balances, current status, governed metricsSQL / metric APIStructured source is authoritative
Broad mixed evidenceHybrid + rerankerFuse lexical and dense candidates, then rerank
Greeting, transformation, supplied-context taskNo retrievalRetrieval adds latency and noise

A router you can test

Start with deterministic signals: identifier regexes, known entity linking, question type, and available source capabilities. Return a route plus confidence. Low-confidence cases fan out to BM25 and dense retrieval; combine ranks with reciprocal rank fusion, rerank, and keep provenance. Graph retrieval should be explicit, not the default merely because a graph exists.

Evaluate the router separately from answer generation. Build a labelled query set with expected route, expected evidence, and abstention cases. Measure route accuracy, evidence recall, latency, and cost. An answer can sound correct while the router silently chose stale or non-authoritative evidence.

Reflect

Sample twenty real queries from one application and label the route each should take before looking at the current implementation.

  • Which queries should bypass RAG and hit an authoritative API or metric layer?
  • Which exact-token queries are currently harmed by dense-only retrieval?
  • What confidence threshold should trigger hybrid fan-out or abstention?

Reading in progress · 0 of 4 activities done