Embeddings find paraphrases. They miss exact strings like a policy name, a fee code or an error message.
Anthropic's write-up gives a support example: a user searches a technical support database for Error code TS-999. An embedding model may return results about error codes in general, while BM25 matches the exact string.
Support traffic has plenty of both kinds of query. So run both retrievers and fuse them.
Anthropic tested each setup on codebases, fiction, ArXiv papers and science papers, not support tickets. Their evaluation metric was 1 minus recall at 20: the share of relevant documents that fail to show up in the top 20 chunks.
Reranked contextual embeddings plus contextual BM25 cut the top-20 failure rate by 67%, from 5.7% to 1.9%.
That cut sounds huge because failure rates are small. Recall went from 94.3% to 98.1%. Measure on your own tickets before you quote either number.
In the editor, write bm25(query, docs) from the formula in its docstring. docs holds three tiny chunks as lists of words, and only the first holds the exact code ts-999.