castorini/pyserini

Pyserini is a Python toolkit for reproducible information retrieval research with sparse and dense representations.

What it solves

Pyserini simplifies the process of performing reproducible information retrieval (IR) research. It provides a unified, easy-to-use Python interface for both sparse and dense retrieval methods, helping researchers implement the first-stage retrieval component of multi-stage ranking systems without needing to manage complex, disparate toolkits.

How it works

Pyserini acts as a Python wrapper that integrates two powerful underlying technologies: it uses the Anserini toolkit (built on Lucene) for sparse, lexical retrieval and the Faiss library for dense, vector-based retrieval. It comes as a self-contained Python package that includes prebuilt indexes, evaluation scripts, and support for standard IR test collections, allowing users to run experiments or reproduce existing research results with minimal configuration.

Who it’s for

This toolkit is designed for researchers and developers working in information retrieval and natural language processing who need a reliable, reproducible way to experiment with different retrieval models, including BM25, learned sparse models, and dense vector models.

Highlights

  • Supports diverse retrieval models including traditional lexical (BM25), learned sparse, and dense vector approaches.
  • Enables "two-click reproduction" of experimental runs on major IR test collections.
  • Includes a REST API and an MCP server for flexible integration.
  • Provides extensive tools for indexing, searching, and analyzing term statistics or postings.
  • Offers optional support for multimodal tasks like image search.

Related

  • Project
  • Project
  • Project
  • Project
  • Project