$npx skillfedfor your agent

llama-index-retrievers-bm25

llama-index retrievers bm25 integration

With conditionsPyPI Artificial IntelligenceReleased Mar 2026326.3K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — llama_index_retrievers_bm25-0.7.1-py3-none-any.whl
v0.7.1 · released 2026-03-13 · Python <4.0,>=3.10 · 3 runtime deps: bm25s, llama-index-core, pystemmer

Yes, if you're building a LlamaIndex application and need straightforward keyword-based retrieval. The low install friction, active maintenance, MIT license, and zero known vulnerabilities make it a safe choice. Install only if BM25 ranking fits your retrieval needs; for semantic or dense vector search, you'd want a different retriever.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later (supports current versions up to <4.0).
  • Low install friction with a pure-Python wheel and only three runtime dependencies.
  • Actively maintained as of March 2026, with no known security vulnerabilities.

License · maintenance · safety

MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects, with only attribution required.

last release 2026-03-13 (154 days)

0 known vulnerabilities (OSV.dev, 2026-08-14) · 326,294 downloads/mo, #7,578 on PyPI

Verify before relying

pip install llama-index-retrievers-bm25

from llama_index.retrievers.bm25 import BM25Retriever

retriever = BM25Retriever.from_documents(documents)
results = retriever.retrieve(query_str)
  • Whether BM25Retriever integrates seamlessly with other LlamaIndex components beyond core retrieval.
  • Performance characteristics when indexing or querying large document collections.
  • How pystemmer is used internally and whether stemming behavior is configurable.
Same gist for agents: .md · .json

What it is and what it does

This package provides a BM25-based retriever for LlamaIndex, a framework for building retrieval-augmented generation (RAG) applications. BM25 is a probabilistic ranking function that scores documents based on keyword relevance, making it useful for traditional full-text search within LlamaIndex pipelines. The retriever accepts a collection of documents, builds an index using the bm25s library, and returns ranked results for text queries.

It sits between your document collection and LlamaIndex's query pipeline, handling the retrieval step without requiring external search infrastructure. The package depends on bm25s for the core ranking algorithm, llama-index-core for integration hooks, and pystemmer for linguistic preprocessing. It's designed for developers who want keyword-based retrieval as part of a larger LlamaIndex application, particularly when semantic or hybrid search isn't the primary need.

Use it for

  • Build a RAG pipeline where keyword matching is the primary retrieval strategy before passing results to an LLM.
  • Add full-text search to a document Q&A system without setting up a separate search engine.
  • Combine BM25 retrieval with other LlamaIndex retrievers in a hybrid or ensemble approach.
  • Index and retrieve from domain-specific documents where exact keyword matches are important.
  • Prototype or test retrieval logic quickly without infrastructure overhead.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you're building a LlamaIndex application and need straightforward keyword-based retrieval.

The low install friction, active maintenance, MIT license, and zero known vulnerabilities make it a safe choice. Install only if BM25 ranking fits your retrieval needs; for semantic or dense vector search, you'd want a different retriever.

Install

llama-index-retrievers-bm25 on PyPI

Before you install

Low install friction with a pure-Python wheel and only three runtime dependencies. Actively maintained as of March 2026, with no known security vulnerabilities.

Requires Python 3.10 or later (supports current versions up to <4.0).

License in practice

MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects, with only attribution required.

Quickstart

pip install llama-index-retrievers-bm25

from llama_index.retrievers.bm25 import BM25Retriever

retriever = BM25Retriever.from_documents(documents)
results = retriever.retrieve(query_str)

Verify before relying

  • Whether BM25Retriever integrates seamlessly with other LlamaIndex components beyond core retrieval.
  • Performance characteristics when indexing or querying large document collections.
  • How pystemmer is used internally and whether stemming behavior is configurable.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release <4.0,>=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
3 packages
bm25sllama-index-corepystemmer
MaintenanceActively maintained 154 days since the last release
First released
Downloads326,294 / month, #7,578 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14

Evidence: llama_index_retrievers_bm25-0.7.1-py3-none-any.whl

Tags

Capabilities
bm25 retrieval llama indexkeyword search document rankingfull-text search integrationbm25 ranking algorithmllama index retriever plugintext-based document retrievalinformation retrieval bm25
Topics
retrieval-augmented-generationinformation-retrievalllama-index-integration

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “bm25 retrieval llama index”

Give your agent the search over MCP, or paste the wish link into any chat.

More Artificial Intelligence packages

litellm With conditions
PyPI · Artificial Intelligence · released Aug 2026

LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.

Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.

MITcompiled wheel
682.8Mdownloads / mo
huggingface-hub Worth it
PyPI · Artificial Intelligence · released Aug 2026

Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.

Install it if you work with Hugging Face Hub models or datasets.

Apache-2.0pure Python · 3.10.0+
442.4Mdownloads / mo
langchain Worth it
PyPI · Python Modules · released Aug 2026

LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.

MITpure Python
315.4Mdownloads / mo
hf-xet With conditions
PyPI · Artificial Intelligence · released Aug 2026

hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.

Apache-2.0compiled wheel · 3.8+
258.4Mdownloads / mo
tokenizers Worth it
PyPI · Artificial Intelligence · released Apr 2026

Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.

Apache-2.0compiled wheel · 3.10+
222.9Mdownloads / mo
transformers Worth it
PyPI · Artificial Intelligence · released Aug 2026

Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.

Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.

permissive licensepure Python · 3.10.0+
186.6Mdownloads / mo

See also llama-index-vector-stores-qdrant · llama-index-vector-stores-chroma · llama-index-vector-stores-faiss · llama-index-embeddings-openai · rank-bm25 · llama-index-embeddings-langchain · bm25s · llama-index-vector-stores-postgres · llama-index-vector-stores-redis · llama-index-indices-managed-llama-cloud

Further reading