Hybrid search
Vector search is great at meaning but bad at exact matches. Keyword search is the opposite. Each fails on cases the other handles. Modern RAG runs both in parallel and merges the results. Pick a query and watch where each strategy succeeds or trips.
Try three retrieval modes
Use the buttons to swap queries. Each column shows a different retriever on the same ten-document mini corpus — watch keyword dominate on order IDs and error codes, vector dominate on paraphrases, and hybrid (RRF) recover when either branch alone would miss.
Keyword (BM25)
Counts exact word matches, weighted by rarity. Fast, exact, but misses synonyms.
Vector (semantic)
Compares meaning via embeddings. Catches synonyms, misses exact codes and rare terms.
Hybrid (RRF)
Merges both rankings using Reciprocal Rank Fusion. Best of each, fewer blind spots.
How the merge works
Reciprocal Rank Fusion
For each result in each list, compute 1 / (k + rank), where k is usually 60. Sum the scores across both lists. Sort by total. A doc that ranks #1 in keyword and #3 in vector beats a doc that ranks #2 in only one.
Why it's robust
RRF doesn't need either score on the same scale — keyword scores and vector distances aren't comparable directly. It only uses ranks. Swap embedding models or BM25 implementations and you don't have to retune.
1/(k+rank) (often k=60) in each list and sum. No need to put BM25 scores and cosine distances on the same scale.