

Comprehensive guide to combining BM25 keyword search with vector semantic search using reciprocal rank fusion and reranking. Essential pattern for production RAG systems in 2026.
Loading more......
Hybrid search typically combines BM25 for sparse (keyword-based) retrieval with embeddings from models such as Sentence Transformers or OpenAI embeddings for dense (semantic) retrieval. The formula: Hybrid Search RAG = BM25 (keywords) + Vectors (semantic) + Reranking (precision).
The BM25 (Best Match 25) algorithm is a popular and effective ranking function employed for keyword matching. BM25's role is to ensure exact keyword matches and term rarity are prioritized.
Semantic vector search uses high-dimensional embeddings and approximate nearest neighbor (ANN) algorithms (e.g., HNSW) to retrieve conceptually similar documents regardless of exact term overlap.
Reranking takes results from different search methods and reorders them based on additional processing using the content of the documents, not just the scores. This step significantly improves precision.
RRF provides a way to merge rankings from semantic and token-based search results. It assigns scores based on how high each document ranks in both keyword and vector searches.
In practice, RRF is the best starting point for hybrid search because of its simplicity and resilience to mismatched score scales.
Common frameworks for hybrid search in RAG: