BM25 (Wikipedia) also known as theOkapi BM25, is a ranking function used in information retrieval systems to estimate the relevance of documents to a given search query.BM25Retrieverretriever uses therank_bm25package.
Create New Retriever with Texts
Create a New Retriever with Documents
You can now create a new retriever with the documents you created.Use Retriever
We can now use the retriever!Preprocessing Function
Pass a custom preprocessing function to the retriever to improve search results. Tokenizing text at the word level can enhance retrieval, especially when using vector stores like Chroma, Pinecone, or Faiss for chunked documents.Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.