Hybrid Search for RAG: Combining Lexical and Semantic Retrieval
Semantic (vector) search captures meaning but misses exact terms; lexical (keyword) search nails exact terms but misses meaning. Production RAG uses both. Here is why hybrid search wins and how to build it.
Why one retriever is not enough
A single retriever consistently misses something. Pure vector search struggles with exact identifiers — product codes, error strings, names, acronyms — because they are not semantically distinctive. Pure keyword search misses paraphrase and meaning. Hybrid search combines lexical and semantic retrieval, then fuses and reranks the results, for higher recall and precision than either alone.
How fusion and reranking work
Each retriever returns a ranked list. Reciprocal Rank Fusion (RRF) merges them by rank without needing to normalize scores across two different scoring systems — simple and robust. Alternatively you can normalize and weight the scores. A reranker then re-orders the fused candidates by true relevance to the query. Keeping both lexical and vector scores visible makes the system debuggable.
Practical advice
- ●Do not force the retrievers to compete — fuse their complementary strengths.
- ●Benchmark BM25 + vector + reranker against one labelled query set before scaling.
- ●Normalize scores before fusion, and keep individual scores visible for debugging.
- ●Measure Recall@k and groundedness on a fixed evaluation set, not by eyeballing.