# dorianbrown/rank_bm25

A Collection of BM25 Algorithms in Python

Repository: https://github.com/dorianbrown/rank_bm25
Canonical: https://ross.abutalabs.com/products/rank_bm25
Language: Python
License: Apache-2.0
License Family: permissive
Topics: bm25, information-retrieval, algorithm, ranking
Last push: 2026-05-02T22:17:06+00:00

## Health v2 (maintenance only)
Score: 59/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 80, release rhythm 8, longevity 100
- inputs: {"age_days": 2782, "days_push": 123, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1378, forks 109 (observed 2026-08-28T04:04:33.486965+00:00)

## What it is
A Python library implementing several BM25 ranking algorithms (Okapi BM25, BM25L, BM25+) for scoring and ranking documents against a query. It is a lightweight, in-memory 'two line search engine' that requires users to handle their own tokenization and preprocessing.

## Use cases
- rank documents by relevance to a query in python
- build a simple keyword search engine
- score a corpus with BM25
- implement lexical retrieval for RAG pipelines
- compare BM25 variants like BM25L and BM25+

## When to choose
- you need a simple, dependency-light BM25 implementation for small to medium corpora
- you want to prototype lexical search or hybrid retrieval quickly
- you want control over your own tokenization and preprocessing

## When to avoid
- you need high-performance retrieval over large-scale production corpora
- you need built-in indexing, persistence, or text preprocessing
- you need semantic/vector search rather than lexical ranking

## Facets
- artifact type: library
- maturity: stable
- function: search-engine, nlp
- domain: -
- platform: python
- tags: bm25, document-ranking, information-retrieval, text-search, search, natural-language-processing

## Member repositories
- dorianbrown/rank_bm25 (main) score 59

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:33.486965+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:40:22.053086+00:00, confidence not recorded.
  - readme: https://github.com/dorianbrown/rank_bm25 (fetched 2026-08-28T04:04:33.486965+00:00, sha 2ee406166b49)
  - registry_pypi: https://pypi.org/pypi/rank_bm25/json (fetched 2026-08-29T11:56:24.319067+00:00, sha aa1868880cbb)
- Data as of 2026-08-30T08:39:29.467469+00:00.
