When would you use hybrid search instead of pure vector search, and how do you combine the results?
Answer it out loud first, then compare. That's what makes it stick.
Vector search matches meaning but is weak on exact strings: product codes, clause numbers, error messages, rare names. Keyword search (BM25) is the opposite. Customer corpora are full of exact strings, so I run both in parallel and merge the two ranked lists with reciprocal rank fusion, which uses rank positions rather than incompatible scores. Hybrid gives recall; then I rerank the merged list for precision. I'd check it helps by comparing recall@k on real questions.
- Vector: meaning. BM25: exact terms
- Run both in parallel on the same filters
- Merge with reciprocal rank fusion (k around 60)
- Tune weights only if evals show a gap
- Rerank the fused list
This is one of the highest-signal short answers in a RAG interview. Say why, then how to merge, then how you would verify.
Why both.
- Dense (vector) search embeds query and chunk so paraphrases match: 'how long do I have to return it' finds 'refund window'.
- Sparse (BM25) search matches the literal terms: policy numbers, SKUs, clause references, acronyms, people's names, error codes. Embedding models often blur these.
- Enterprise documents are full of exact strings, so each method misses cases the other catches.
How to merge: reciprocal rank fusion (RRF).
- The two methods produce scores on different scales (cosine similarity vs BM25), so adding them is meaningless.
- RRF ignores scores and uses rank: each list contributes 1 / (k + rank) to a document, summed across lists, with k commonly 60. Documents ranked high in both lists rise to the top.
- It needs no training and adds negligible latency. Elasticsearch, Azure AI Search and OpenAI file search all support RRF-style fusion, and some let you weight the dense and sparse sides.
Practical settings.
- Fetch a generous candidate set from each side (for instance 50-100), fuse, then trim.
- Apply the same permission and metadata filters on both retrievers; a filter on only one side is a leak.
- If you will rerank with a cross-encoder, remember many rerankers accept a limited number of candidates (Azure's semantic ranker takes up to 50), so size the fused list to match.
Verify, do not assume. On a labelled question set, compare vector-only, BM25-only and hybrid on recall@10 and MRR, sliced by question type. Expect the gap to be largest on exact-identifier questions. If hybrid does not help on this customer's data, say so and keep the simpler system.
When pure vector is fine: conversational questions over prose with no codes or names, or a tiny corpus.
Trade-off to mention: two indexes to keep in sync, which means ingestion and deletion must update both.
- Why not just add the BM25 score and cosine score?
- Users search by part number and results are bad. Vector, BM25 or something else?
- How would you tune the weight between the two sides?
- RAG system design interview: a worked FDE answer (prep, 2026-09-25) Hybrid retrieval with BM25 for policy numbers and clause references, merged by reciprocal rank fusion, then a reranker.
- Forward Deployed Engineer Interview Prep (2026) (prep, 2026-02-13) FDE system-design examples combining vector search with filters and keyword match for exact terms, including a RAG assistant design on Databricks.
- FDE System Design Interview: Customer Deployments, RAG, Integrations (prep, unknown) Law-firm RAG design using keyword plus vector retrieval because lawyers search defined terms, case names and clause numbers.
- Hybrid Search Scoring (RRF) - Azure AI Search (docs, unknown) RRF merges parallel ranked lists using 1/(rank + k) with k around 60; semantic ranking runs after RRF.
- Reciprocal rank fusion | Elasticsearch Reference (docs, unknown) RRF formula, default rank_constant of 60, and rank_window_size controlling result-set size per retriever.