BM25 is a lexical ranking function for prioritizing documents with exact query terms. It scores term frequency, document frequency, and document-length normalization, complementing semantic search when meaning alone is too broad. section 7.2.4
Exact terms versus related meaning
A search for “augmented workflow” may retrieve broadly related documents through semantic search, while BM25 prioritizes documents containing that exact product phrase. The same hybrid approach helps retrieve API endpoints and distinguish “business” class from documents about doing business. section 7.2.4
Figure 7.8 Combining semantic and lexical search can increase overall retrieval accuracy.
Shows how combining semantic and lexical search can improve overall retrieval accuracy. section 7.2.4




