
Fast local BM25 keyword search over texts or a code/docs folder. Rust core, no network.
Public tool metadata for what this MCP can expose to an agent.
bm25_index_textsNo parameter schema in public metadata yet.
bm25_index_pathNo parameter schema in public metadata yet.
bm25_searchNo parameter schema in public metadata yet.
bm25_list_indexesNo parameter schema in public metadata yet.
bm25_drop_indexNo parameter schema in public metadata yet.
Sponsors
RAPIDBM25_ROOTSDirectories bm25_index_path may read (os.pathsep-separated). Default: the working directory.
RAPIDBM25_CACHEFolder-index cache directory. Default: ~/.cache/rapidbm25.
Drop-in, Rust-native replacement for rank_bm25's BM25Okapi, BM25L, and BM25Plus.
Same constructor, same attributes, bit-for-bit identical scores, about 1,470× faster
get_scores, plus a fast top_n, save/load, an incremental index, batch search,
optional tokenizers, hybrid fusion, a ready-to-run MCP server, and an agent skill.
pip install rapidbm25
Prebuilt wheels: CPython 3.9–3.15 on Linux (manylinux_2_28 and musllinux_1_2, x86_64 and aarch64), macOS (x86_64 10.13+ for CPython 3.9–3.13 and 10.15+ for 3.14–3.15, arm64 11.0+), and Windows (x86_64). Other platforms build from the sdist and need a Rust toolchain (1.85+).
# from rank_bm25 import BM25Okapi
from rapidbm25 import BM25Okapi
docs = ["Hello there good man!", "It is quite windy in London", "How is the weather today?"]
bm25 = BM25Okapi([d.split(" ") for d in docs]) # also: tokenizer=..., k1, b, epsilon
rapidbm25