xhluca/bm25s
Fast BM25 search in Python, powered by Numpy and Numba observed · 2026-08-28
Health v2 · maintenance only
92/100
- Activity 99
- Release rhythm 99
- Longevity 62
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: 14.0
- age_days: 875
- days_rel: 8
- days_push: 8
- n_releases_24m: 27
Adoption not part of the score
1774 stars · 101 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
BM25S is a pure Python library implementing BM25 lexical ranking using Numpy/Scipy sparse matrices with an optional Numba backend, achieving speeds comparable to or exceeding Elasticsearch without Java or servers. It supports BM25 variants (Okapi, BM25L, BM25+), tokenization, stemming, and Hugging Face Hub index sharing.
Use cases
- rank documents by relevance to a query in Python
- add fast lexical search to a RAG pipeline without Elasticsearch
- replace rank-bm25 with a much faster BM25 implementation
- build keyword retrieval over a corpus with minimal dependencies
- score and retrieve top-k documents for hybrid search
- share and load prebuilt BM25 indices via Hugging Face Hub
When to choose
- you need fast BM25 scoring entirely in Python with no Java or web server
- you want a lightweight, low-memory lexical retriever for RAG or hybrid search
- you need BM25 variants like BM25L or BM25+ out of the box
When to avoid
- you need a full search engine with distributed indexing, faceting, or analytics
- you require advanced analyzers or multilingual tokenization matching Elasticsearch quality
- your corpus is too large to fit in memory as sparse matrices
Facets
library · maturity active
search-engine nlp rag machine-learning python cross-platform bm25 lexical-search information-retrieval sparse-matrices numpy numba text-ranking search natural-language-processing retrieval-augmented-generation
3 sources
- readme: https://github.com/xhluca/bm25s · fetched 2026-08-28 · 0dd8ddb0f31f
- homepage: https://bm25s.github.io · fetched 2026-08-29 · 89cee17e9cc9
- registry_pypi: https://pypi.org/pypi/bm25s/json · fetched 2026-08-29 · c0f7bdada977
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| xhluca/bm25s | main | 92 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem