← All questions
RAGMedium· RAG Fundamentals & Basics

What is hybrid search in RAG, and why does it outperfor...

Vector search is good at meaning and bad at exact tokens — the product codes, error IDs, and proper nouns that often carry the most signal in enterprise text simply don’t embed distinctively. Keyword search (BM25) is the mirror image: exact-match strong, paraphrase-blind.

Hybrid search runs both in parallel and fuses the resulting rankings, usually with Reciprocal Rank Fusion: score = 1/(k + rank_bm25) + 1/(k + rank_vector). Fusing by rank rather than raw score sidesteps the problem that BM25 and cosine-similarity scores live on incomparable scales — a document that ranks reasonably well in both systems can outscore one that ranks #1 in only one of them.

The practical payoff shows up hardest on queries that mix a concept with an identifier — “refund policy for order #48213” — where neither method alone would surface the right chunk reliably.

Code playground (Python)