
Dan Patiño
AI Strategy & Innovation at Coderhouse
Artificial Intelligence
What Is Hybrid Search and Why RAG Pipelines Combine Dense and Sparse Retrieval
Hybrid search is a retrieval pattern that combines dense (vector / semantic) search with sparse or keyword search—often BM25 full-text, sparse embeddings, or both—then merges the ranked lists into one result set. Dense retrieval finds passages that mean the same thing even when wording differs; sparse/keyword retrieval catches exact tokens such as error codes, SKUs, API names, and rare jargon. Vendor guides describe hybrid queries as running both signals (in one request or via fusion) and ranking the union with methods like Reciprocal Rank Fusion (RRF) (Azure AI Search hybrid overview; Google Cloud Vertex AI Vector Search hybrid search).
Why it matters now: RAG systems that rely only on embeddings miss out-of-vocabulary identifiers and brand-new product strings the embedding model never saw. Keyword-only search misses paraphrases. Hybrid search is how production RAG closes that gap before the LLM generates an answer—especially when you already store embeddings alongside searchable text fields.
Dense vs sparse signals
Dense retrieval embeds queries and documents into continuous vectors and ranks by similarity (for example cosine or inner product over HNSW indexes). It shines on natural-language questions and synonymy.
Sparse / keyword retrieval scores term overlap. Classic BM25 uses term frequency and inverse document frequency over tokenized text. Learned sparse models (for example SPLADE-style approaches) produce high-dimensional sparse vectors that still behave like expandable keyword weights. Pinecone’s docs frame hybrid as combining a keyword signal with a semantic signal—full-text plus dense, sparse plus dense, or a text filter on dense results (Pinecone hybrid search).
Each method fails where the other succeeds. Hybrid keeps both candidate pools in play.
How fusion works (RRF and friends)
A common architecture:
Run dense top-k and sparse/BM25 top-k in parallel (or one hybrid API call).
Merge rankings with Reciprocal Rank Fusion: documents that rank well on either list rise; documents strong on both rise further.
Optionally apply a second-stage reranker (cross-encoder) on the fused shortlist before packing context into the prompt.
Azure AI Search documents hybrid as a single request with both search and vectorQueries, parallel execution, and RRF over BM25 plus vector similarity. Weighting knobs (candidate counts, alpha-style balances, max text recall size) let you favor jargon-heavy or conversational corpora without rewriting the pipeline.
When hybrid search helps RAG
Support and ops corpora — users paste stack traces and error codes; BM25 finds the exact string while dense finds related runbooks.
Product catalogs and policies — SKUs and clause ids need exact match; marketing copy needs semantics.
Multilingual or paraphrase-heavy FAQs — dense covers wording drift; sparse anchors proper nouns.
Fresh entities — new codenames and releases often sit outside the embedding model’s comfort zone until you retrain or re-embed; keywords still match.
Hybrid is not a substitute for chunking quality, metadata filters, or evaluation. It is a retrieval upgrade that usually improves recall@k on mixed query distributions. Measure with your own golden questions: hybrid should lift exact-id queries without tanking semantic ones.
Implementation checklist
Index both representations: searchable text fields and embedding fields (or dense + sparse vectors) for every chunk.
Keep chunk text faithful to source tokens so BM25 can see the identifiers users type.
Tune candidate depth: retrieve enough from each channel for RRF, then cap what enters the prompt.
Add filters early (tenant, product, language) so both channels search the same allowed set.
Log which channel “won” for sampled queries—that informs alpha and whether to invest in sparse models vs better embeddings.
FAQ
Is hybrid search the same as reranking?
No. Hybrid merges two (or more) first-stage retrievers. Reranking re-scores a shortlist with a heavier model. Many strong RAG stacks do hybrid then rerank.
Do I always need sparse vectors, or is BM25 enough?
BM25 full-text is enough for many enterprise apps. Learned sparse vectors help when you want expandable term weights inside a vector index. Start with BM25 + dense; add sparse embeddings if metrics stall.
Will hybrid always beat dense-only?
On benchmarks and vendor reports, hybrid (especially with semantic ranking) often wins on mixed workloads. On purely conversational corpora with few identifiers, dense-only can be close. Validate on your query log.
How does hybrid relate to GraphRAG?
Hybrid improves lexical+semantic recall over a text/vector index. Graph-augmented RAG adds structured entity/relation traversal. They solve different failure modes and can be combined when both text similarity and graph context matter.
If you want to build retrieval-aware LLM apps and the data workflows behind them, explore Coderhouse’s courses below.
AI Engineering Course — design RAG pipelines, agents, and production LLM applications.
Data Analytics Course — strengthen the data skills that power indexing, evaluation sets, and product metrics.
I'm Dan Patiño, head of AI Strategy & Innovation at Coderhouse. My day-to-day work involves merging the tactical management of e-commerce (CRO, Email Marketing and SEO) with the development of disruptive solutions. I specialize in building internal AI-powered apps to automate tasks and boost innovation within the team. I firmly believe that technology is strategy's best ally. To dive deeper into my professional journey, I'll be waiting for you on my LinkedIn profile.