← RAG & Grounded Generation
BM25
Also known as: Best Match 25
BM25 is a classic term-frequency-based ranking algorithm that scores documents by how often query terms appear in them, adjusted for document length and term frequency saturation. It requires no learned embeddings and is extremely fast at indexing and retrieval time. In RAG systems, BM25 serves as either the sole sparse retriever or the keyword component in a hybrid search pipeline, excelling at matching rare terms, product codes, and proper nouns that embedding models may underweight.