BM25 comes from the Okapi system at City University in London, which Stephen Robertson's team presented as Okapi at TREC-3 in 1994. It ranks documents by the query words they contain, and it is the keyword half of hybrid search today.

A RAG pipeline fuses that ranking with one from a dense vector index, then reranks the candidates and passes the survivors to the model. A person scanning ten search results can skip a bad one, and a model reads whatever lands in the prompt as evidence.

Plain hybrid search came last of seven retrievers in the production benchmark the hybrid search guide reports, which is why this topic goes on to the stages after fusion.

Retrieval quality is decided before generation, so each retrieval stage gets measured on its own before the generated answer is judged.

Foundations

Retrieval quality

Cost

Evaluation

Benchmarks

Which stage of a RAG pipeline should be measured first?

Measure retrieval before generation, because a wrong chunk in the prompt reads as evidence. The guide to RAG evaluation covers recall and precision for the retrieved set.

Agent memory reuses this retrieval stack for a different job, and the AI agent memory topic covers where the two differ.

A retrieved token costs latency and money like any other, and the LLM inference topic covers that budget.