Cards/AI SystemsSystem Design · Day 27Aug 27, 2026

The Search That Can't Spell

The Search That Can't Spell — system design card, day 27, AI systems: BM25 keyword results and vector results merged by reciprocal rank fusion so an exact citation surfaces above essays about the concept

A user searches for "GDPR Article 17." The vector database returns essays about privacy philosophy, a data erasure overview, a compliance guide. The article itself is nowhere.

Embeddings understand meaning, which is the point of them and also the failure. Meaning is blurry, and some queries aren't about meaning at all. Product codes, error numbers, names, legal citations — these need the literal string, and semantic similarity returns something nearby, which for an exact citation is the same as being wrong.

The old keyword search everyone abandoned was excellent at exactly this. So run both.

BM25 finds the literal string. Vectors find the concept. Then merge the two lists with Reciprocal Rank Fusion, which scores a document by its position in each list rather than its raw score:

RRF(d) = Σ 1 / (k + rank(d)), with k commonly 60 to dampen the tail.

Position is the whole trick. A BM25 score and a cosine distance are incomparable numbers, and rank is the one currency both lists share.

Anything ranked well by either method surfaces. Anything ranked well by both wins.

When two methods fail differently, running both is cheaper than perfecting either.