Hybrid search lab
The same query, four ways: keywords (BM25 with typo tolerance), meaning (vectors), and two ways of combining them. Green rows are the results we expect. Swipe the columns on mobile.
Tuning
Evaluate the examples
Mean reciprocal rank (MRR: 1 = the first result is always right) and precision of the top 5, over all example queries of this collection, for each strategy and vector size.
Under the hood
- Keywords: BM25 over words and word pairs. Unknown words are matched to close vocabulary words (one or two typos), which is how “baterry” still finds “battery”.
- Meaning: cosine similarity between your query vector and precomputed document vectors. Wins on paraphrases and other languages, loses on codes like “E-311”.
- Linear mix: both scores normalised to 0–1 and averaged with the weight you choose.
- RRF (reciprocal rank fusion): adds 1/(k + rank) from each list. No weights to tune and robust to score scales.
- Vector size: the full engine is trained so that the first 512, 256 or 128 numbers of a fingerprint still work on their own (“Matryoshka” vectors). Smaller fingerprints mean smaller indexes and faster scoring.