Why pure vector search fails in enterprise RAG — and how RRF fixes it
Vector search fails on exact product codes, acronyms, and part numbers. Learn how combining BM25 keyword matching with dense vectors using Reciprocal Rank Fusion (RRF) and cross-encoder reranking boosts retrieval precision by +23%.
Ahad Ahmad Khan
·
May 10, 2026
6 min read
RAGAzure AI SearchInformation RetrievalPython
Expand
Dense vector search is great for semantic queries like "How do I reset my password?" But when an enterprise user searches for "ISO-27001-A.9.2" or "SKU-4821-B", pure vector similarity fails. Embeddings map exact string identifiers to semantically adjacent terms, returning documents about general security policies or unrelated product SKUs instead of the exact match.
In production RAG systems across 5,000+ enterprise documents, relying solely on dense vector retrieval produced a Hit Rate @ 5 of less than 68%. Switching to a hybrid retrieval pipeline powered by Reciprocal Rank Fusion (RRF) and cross-encoder reranking boosted retrieval precision by +23%.
Here is why single-signal vector search breaks down in enterprise environments, how RRF mathematical score fusion works, and how to implement it on Azure AI Search.
What BM25 Catches That Dense Embeddings Miss
Dense embedding models (like text-embedding-3-large or bge-large-en-v1.5) project text into a continuous vector space. They excel at capturing conceptual intent, synonymy, and paraphrase. However, they suffer from three distinct failure modes in technical enterprise corpora:
Exact Identifiers: Terms like CVE-2024-21412 or error codes like ERR_SOCKET_TIMEOUT_10054 are flattened into embedding clusters representing general security vulnerabilities or network issues.
Domain Acronyms: In a corporate setting, MFA might mean Multi-Factor Authentication, Master of Fine Arts, or Ministry of Foreign Affairs. Without exact lexical matching, vector search frequently surfaces out-of-domain matches.
Low-Frequency Jargon: Specialized part numbers, chemical formulas, and internal codenames rarely have strong representation in pre-trained embedding vocabularies.
Conversely, BM25 (Best Matching 25) is a probabilistic term-frequency/inverse-document-frequency (TF-IDF) ranking algorithm. It does not care about semantic meaning; it measures exact term frequency penalized by document length.
Retrieval Signal
Strengths
Failure Modes
Dense Vector
Synonyms, natural language queries, conceptual search
Combining both signals ensures that whether a user searches by natural concept or exact SKU, relevant chunks surface to the top.
How Reciprocal Rank Fusion (RRF) Works
When combining BM25 keyword results with dense vector results, you cannot simply add their raw scores together. BM25 scores are unbounded positive numbers (e.g., 12.45), while cosine similarity scores range from -1.0 to 1.0 (or 0.0 to 1.0).
Normalizing raw scores requires tuning arbitrary min-max scalars that break whenever the document index changes.
Reciprocal Rank Fusion (RRF) solves this by ignoring raw score magnitudes entirely and operating exclusively on ranks.
The RRF Formula
For a document d appearing in rank positions r_m(d) across multiple retrieval lists M:
code
1RRF_score(d) = sum( 1 / ( k + r_m(d) ) ) for m in M
Where:
M is the set of retrieval systems (e.g., BM25 and Dense Vector).
r_m(d) is the 1-indexed rank of document d in system m.
k is a constant parameter (typically k = 60).
Why k = 60?
The smoothing constant k = 60 prevents top-ranked items from dominating the fused score excessively. A document ranked #1 in BM25 contributes 1 / (60 + 1) = 0.01639. A document ranked #2 contributes 1 / (60 + 2) = 0.01612. The difference is subtle enough that a document appearing at rank #3 in both BM25 and Vector search will outrank a document appearing at #1 in BM25 but missing entirely from Vector search.
python
1defreciprocal_rank_fusion(
2 vector_results:list[str],
3 bm25_results:list[str],
4 k:int=60
5)->list[tuple[str,float]]:
6"""
7 Combines two ranked lists of document IDs using Reciprocal Rank Fusion.
Azure AI Search provides native hybrid search with built-in RRF. When you send a query containing both vectorQueries and a text search string, Azure AI Search executes both searches in parallel and applies RRF automatically before returning results.
Here is how to configure hybrid search with semantic reranking using the Python SDK:
RRF produces a strong candidates list (e.g., top 50 chunks). However, because RRF operates solely on rank positions, it does not evaluate deep contextual alignment between the user query and the retrieved text.
Adding a second pass with a cross-encoder reranker (such as bge-reranker-large or Azure's Semantic Reranker) analyzes the query and candidate chunk simultaneously through multi-head self-attention.
Loading diagram...
While bi-encoders generate separate embeddings for queries and documents (fast retrieval), cross-encoders process query + document together (high accuracy, higher latency). By limiting the cross-encoder to the top 50 RRF candidates, total pipeline latency remains under 200ms while retrieval accuracy reaches 90%+.
Benchmark Results
Testing on an internal enterprise dataset of 5,000+ technical PDF documents produced the following precision metrics across 250 evaluation queries:
Retrieval Strategy
Hit Rate @ 5
MRR @ 5
p99 Latency
Dense Vector Only (ada-002)
67.4%
0.54
85ms
BM25 Keyword Only
58.2%
0.49
35ms
Hybrid RRF (BM25 + Vector)
84.8%
0.72
110ms
Hybrid RRF + Semantic Reranker
91.2%
0.84
185ms
The combination of BM25 exact keyword matching, dense vector semantic search, RRF score fusion, and cross-encoder reranking represents the baseline architecture for production enterprise RAG.
Full implementation details and test benchmarks are available in the Document Intelligence RAG case study.