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 Distribution

retrievalx-0.1.1.tar.gz (58.1 kB view details)

Uploaded Source

Built Distribution

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

retrievalx-0.1.1-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.1.tar.gz.

File metadata

  • Download URL: retrievalx-0.1.1.tar.gz
  • Upload date:
  • Size: 58.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for retrievalx-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a1715bf291387617b0375efbb9487956fd61ce6d964060a7e261d6813d1b26ee
MD5 6d5251310f653bf38780b7fefa449b83
BLAKE2b-256 07ddeb34cc6cd297c9bc7b94aa6457a3706bc33eccab6edff6dccda6829069a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for retrievalx-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 87169e2e78a452b6bbbaa293de6381af65b785d1dbb7ed59b4e5b75dedef7821
MD5 45c65dfd5b04f0895f712c3c621cb938
BLAKE2b-256 32821a7d35bf7ee3625eb90c7c89e8de2f1f5cb441fe9a64e7d37c2dd3569116

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