ChangeGamer

← All resources

Hybrid Search for RAG: BM25 + Dense Retrieval and Fusion

Guide · updated 2026-06-25 · Markdown variant

How to combine lexical (BM25/SPLADE) and dense vector retrieval with Reciprocal Rank Fusion for higher first-stage recall in RAG pipelines — with the RRF formula, a sparse-method comparison table, and verified DB support.


Hybrid search is a first-stage retrieval strategy that runs lexical (sparse) and dense vector search in parallel, then merges the ranked result lists before any reranking step. It consistently outperforms either method alone because each covers the other's failure modes.

Key facts

Why does hybrid beat pure-dense retrieval?

Dense embedding models learn distributional similarity. They fail on tokens that are rare, domain-specific, or absent from their training corpus: product SKUs, error codes, proper nouns, version strings. BM25 treats these as exact term-frequency signals and ranks them correctly.

Conversely, BM25 fails whenever the query and the relevant document use different vocabulary for the same concept ("heart attack" vs "myocardial infarction"). Dense retrieval handles paraphrase well.

Hybrid runs both paths in parallel and fuses the results, so the recall gain is nearly additive with negligible extra latency (the bottleneck is the ANN sweep, not the BM25 sweep).

What sparse retrieval methods exist?

Method How it represents documents Catches Misses
Okapi BM25 TF-IDF-weighted term bag Exact/partial keyword matches; rare tokens Paraphrase; vocabulary mismatch
SPLADE Transformer logits projected to vocabulary space (sparse) Query expansion; some semantic generalisation Needs a GPU at ingest
Learned sparse (LLM-based) Decoder-only LLM as encoder Strong semantic + lexical; good zero-shot Higher ingest cost; less widely deployed

BM25 is the safe default: zero extra model cost, built into every major search and vector DB. Add SPLADE when domain recall tests show consistent BM25 failures.

How do you combine result lists?

Reciprocal Rank Fusion (RRF) is the standard algorithm (Cormack, Clarke, Büttcher, SIGIR 2009). The fused score for document d across m ranked lists is:

RRF(d) = Σ_m 1 / (k + rank_m(d))

where rank_m(d) is the 1-based position of d in list m (documents absent from a list are unscored for it). k = 60 is the conventional default. At rank 1 a document contributes 1/61 ≈ 0.0164 per list; at rank 100, 1/160 ≈ 0.006 — a ratio of only ~2.6×, which makes RRF robust to one method producing a cluster of mediocre hits.

Why RRF and not weighted score combination? BM25 scores and cosine similarities live on incompatible scales; adding or linearly blending them needs per-corpus normalisation that breaks when the index changes. RRF operates only on rank order, so no normalisation is needed — the main reason it dominates production deployments.

Tuning k: lower k (10–20) concentrates weight on top ranks (small corpora); raise k toward 60–100 for large corpora where you want a gentler curve.

Alternative — weighted convex combination: normalise both score distributions (e.g. min-max per query) and blend with a tunable alpha (Pinecone uses alpha = 1.0 for pure dense, 0.0 for pure sparse). Finer control, but needs re-tuning when the distribution shifts. Default to RRF unless you have a labelled eval set.

Where does hybrid fit relative to reranking?

Hybrid is first-stage retrieval — its job is recall@k (get the answer into the candidate set). Reranking is a second-stage precision step that re-scores those candidates with a more expensive model. Pipeline order is always: hybrid retrieve → (optional) rerank → assemble context. See /resources/reranking-for-rag.

Which vector databases support hybrid search natively?

Database Sparse method Fusion Notes
Weaviate BM25 RRF and relativeScoreFusion relativeScoreFusion normalises scores before fusion
Qdrant Sparse vectors (BM25/SPLADE) Universal Query API with prefetch Multi-stage prefetch allows hybrid + rerank in one request
Elasticsearch / OpenSearch BM25 Native RRF retriever Dedicated hybrid/RRF retriever APIs
Pinecone Sparse vectors per record Alpha-weighted combination alpha: 1.0 = pure dense, 0.0 = pure sparse
Milvus Sparse vectors (BM25/SPLADE) Weighted and RRF Sparse-dense hybrid in one collection

Verified as of 2026-06; hybrid APIs evolve quickly, so check each vendor's current release notes.

Practical checklist for agents

Verified sources

#rag #retrieval #hybrid-search #bm25 #embeddings #vector-search #reciprocal-rank-fusion #agents

Category: Guide

Like this? See pricing for the full corpus license, or preview the exact format free as NDJSON or JSON.