BM25
Also known as: Best Match 25, Okapi BM25
Classical TF-IDF-style lexical scoring: a surprisingly strong baseline, still the first stage of many hybrid RAG pipelines.
A bag-of-words ranking function used by traditional search engines. Scores documents by term-frequency × inverse-document-frequency with length normalization. Still the strongest non-neural baseline; commonly used as the first stage in hybrid RAG.
In practice
Ignore it and your dense retriever may underperform. Production interviews increasingly want hybrid (BM25 + dense) plus a reranker.
How it compares
BM25 matches on exact word overlap; embedding search matches on semantic meaning. Best results often combine both.
Related topics
Questions that mention this term
Related terms
Retrieval-Augmented Generation (RAG)
Fetch relevant docs at inference time and stuff them into the prompt so the model can answer from real data.
Chunking
Cutting documents into retrievable pieces before embedding them.
Context Window
The max number of tokens a model can attend to at once.
Hallucination
When a model confidently makes up something that isn't true.
AI System Design
End-to-end design of production LLM systems: ingestion, retrieval, serving, eval, monitoring.
HNSW (Hierarchical Navigable Small World)
A graph-based ANN index with log-time approximate search, excellent recall/latency trade-off.