Hybrid Search
A retrieval strategy that combines semantic dense vector search with lexical keyword search (BM25/Sparse) and fuses their rankings via RRF to capture both meaning and exact terms
Table of Contents
Structure Diagram
What is Hybrid Search?
A retrieval strategy that combines semantic dense vector search with lexical keyword search (BM25/Sparse) and fuses their rankings via RRF to capture both meaning and exact terms. It is a core concept in Retrieval & RAG within AI / ML.
Core Principles
Dense vector search excels at synonyms and intent matching but frequently misses exact identifiers like error codes (ERR-5042), product SKUs, or rare acronyms. Lexical search (BM25) nails exact terms but fails when wording shifts.
Hybrid Search runs both retrievers in parallel and merges their ranked lists—most commonly via Reciprocal Rank Fusion (RRF, Σ 1 / (k + rank))—delivering strong recall across both conceptual and exact queries.
Practical Takeaways
- Make Hybrid Search your default RAG baseline: Adding BM25 alongside dense retrieval routinely lifts Recall@10 by 10–25% on enterprise corpora.
- Prefer RRF over naive score weighting: Because BM25 scores are unbounded while cosine scores lie in
[0, 1], rank-based fusion (k=60) is far more robust than raw score blending. - Pair with a Cross-Encoder Reranker: Use Hybrid Search to gather a broad top-20 to top-50 candidate pool, then rerank down to the best 3–5 chunks for the LLM.
Notable Examples
- Qdrant / Weaviate / Elasticsearch: Provide built-in hybrid dense + sparse/BM25 queries with native RRF fusion.
- Engineering Knowledge Bases: BM25 catches exact API names and error codes while dense vectors capture troubleshooting descriptions.
- E-Commerce Search: Handles both exact SKU lookups and natural-language shopping queries seamlessly.