Adding BM25 next to vector search catches what embeddings blur, like an exact error code, but then you have to merge two result lists whose scores mean different things. BM25 scores have no fixed range and depend on the query and the collection, while cosine similarity sits between -1 and 1, so adding the raw numbers lets whichever side produces bigger numbers win.
The usual answer is reciprocal rank fusion (RRF), which only looks at positions: each doc gets 1 / (k + rank) from every list it appears in, and the totals set the order. k = 60 comes from the original paper (Cormack, Clarke and Büttcher, SIGIR 2009), where RRF beat Condorcet fusion, CombMNZ and the best single system by 4% to 5% on average.
The write-up works one example by hand, the query "payment failed with ERR-482" over five help-center articles. The BM25 ranks come from running its code, the vector order is assumed for the example, and the fifth article (about refunds) comes back from neither search:
| article | BM25 rank | vector rank | RRF score (k = 60) |
|:-|:-|:-|:-|
| kb-12, the ERR-482 article | 1 | 2 | 1/61 + 1/62 = 0.032522 |
| kb-07, "why payments fail" | not returned | 1 | 1/61 = 0.016393 |
| kb-31, an ERR-481 article | 2 | not returned | 1/62 = 0.016129 |
| kb-19, updating billing details | not returned | 3 | 1/63 = 0.015873 |
kb-12 is the one that answers the question, and it wins because both searches found it. Vector search alone would put the general guide first, and BM25 alone would pull in the article about a different error code and miss the general guide.
A few practical bits from it:
- run both searches in parallel and take a few dozen results from each before fusing
- for identifier-heavy queries, a regex router can give the keyword list more weight (weights=[2, 1] in its code), tuned per query type on held-out queries
- rerank after fusion when the right passage shows up but too low. A reranker can't recover a passage neither search returned
- apply the same tenant and permission filters to both sides, or the fused list can leak
RRF isn't always the best fusion, though. In Bruch, Gai and Ingber's analysis, a weighted sum of normalized scores beat RRF in and out of domain, and it only needed a small labeled set to tune.
i work at supermemory, so i'm biased, and the write-up has the BM25 and RRF parts in standard-library Python if you want to check the numbers.
full write-up: https://supermemory.ai/blog/hybrid-search-guide/
If you run hybrid search in LangChain, what are you fusing with, and did you tune the weights or keep the defaults?