#5757th of 101 in RAG, knowledge and search
bm25s
Python BM25 library using eagerly computed sparse scores in NumPy
- Stars
- 1.8k
- License
- MIT
- Last commit
- Nov 2026
- Last release
- Nov 2026
- Language
- Python
1,645 on 1 May 20261,830 on 20 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
bm25s is a Python library for BM25 lexical ranking. It precomputes scores for every document token into sparse matrices, so queries are fast, and it needs only NumPy, with no Java or PyTorch. It includes a tokenizer with stemming and stopwords, five BM25 variants, a CLI, mmap index loading and Hugging Face Hub save/load.
Who it is for: Python developers adding fast keyword search or BM25 retrieval to RAG pipelines
Strengths
- Only NumPy required; no Java or PyTorch dependency
- Supports Lucene, Robertson, ATIRE, BM25L and BM25+ variants
- mmap loading keeps large indices out of RAM
- Includes CLI, CSV/JSONL loading and Hugging Face Hub index sharing
Weaknesses
- Lexical matching only; no embeddings or hybrid search built in
- Library only; no server, UI or REST API
- Retrieval is position-based, so corpus order must match the index
- Scores are precomputed at index time, so changes mean re-indexing
What it needs
- no GPU
- Needs numpy, PyStemmer (optional), numba (optional), huggingface_hub (optional)
What changed
From the release notes. No flag means the note does not say so, not that the upgrade is safe.
Known problems
Reported, then fixed by a linked change
- BM25.save silently skips corpus entries that fail to serialize, misaligning corpus.jsonl with the index ↗ (opens in a new tab)0 reactions · closed 28 Oct 2026Fixed by fix: add opt-in errors for unserializable corpus entries in BM25.save ↗ (opens in a new tab)
Titles are the reporters' own words, taken from the project's GitHub issues and ranked by reactions. We have not tried to reproduce any of them.
Also in RAG, knowledge and search
See all 101| Rank | Project | Score |
|---|---|---|
| #55 | llm-wiki-agentCoding-agent skill that builds an interlinked markdown wiki from ingested documents | 59 out of 100 |
| #56 | orcah-studioSelf-hosted video library indexer with natural-language scene search | 59 out of 100 |
| #58 | obsidian-smart-connectionsObsidian plugin that finds related notes using local embeddings | 58 out of 100 |
| #59 | deep-research-web-uiWeb UI that turns a question into a cited research report | 57 out of 100 |
| #60 | ragentJava Agentic RAG platform with hybrid retrieval, MCP tools and admin console | 56 out of 100 |