Skip to main content

The complete BM25 engine for Python: production-scale, Rust-native

Project description

retrievalx

The complete BM25 engine for Python: all major BM25 variants, production-scale internals, Rust-native performance.

Highlights

  • Rust core + PyO3 bindings, distributed as wheels.
  • BM25 variants: Okapi, Plus, L, Adpt, F, T, Atire, Tf-Idf.
  • Retrieval strategies: Exhaustive DAAT/TAAT, WAND, Block-Max WAND, MaxScore.
  • Incremental updates with tombstones + explicit compaction.
  • Persistence with binary snapshots, metadata sidecar, WAL replay, and mmap loading.
  • Fusion utilities: RRF, linear combination, score normalization.
  • Built-in BEIR benchmark, recall degradation report, and scoring variant comparison runner.

Quickstart

from retrievalx import BM25Index

index = BM25Index.from_documents([
    "rust and python",
    "information retrieval with bm25",
])

print(index.search("rust retrieval", top_k=5))

Real-world Examples

  • examples/it_ticket_search.py
  • examples/legal_clause_discovery.py
  • examples/ecommerce_query_tuning.py
  • examples/security_log_hunt.py
  • examples/wal_crash_recovery.py
  • examples/multilingual_news_monitor.py
  • examples/production_hybrid_reranking.py
  • examples/benchmark_retrievalx_vs_rank_bm25.py

Build

./scripts/check_all.sh

Project Policies

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

retrievalx-0.1.0-cp39-abi3-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file retrievalx-0.1.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for retrievalx-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cdb7350ac9082bd255a21d7502080e5f636d9beaab54ebab4689d3ac478f092b
MD5 cec5e36a61451458e832487ee5c42be7
BLAKE2b-256 3291f550b8a4311f08a82edf55d73a54c0ae714973f71423351922bdaeb05fdd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page