MCPcopy Index your code
hub / github.com/castorini/anserini

github.com/castorini/anserini @anserini-2.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release anserini-2.2.0 ↗ · + Follow
3,784 symbols 14,349 edges 514 files 611 documented · 16%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Anserini

build codecov Generic badge Maven Central LICENSE doi

Anserini is a toolkit for reproducible information retrieval research. By building on Lucene, we aim to bridge the gap between academic information retrieval research and the practice of building real-world search applications. Among other goals, our effort aims to be the opposite of this.* Anserini grew out of a reproducibility study of various open-source retrieval engines in 2016 (Lin et al., ECIR 2016). See Yang et al. (SIGIR 2017) and Yang et al. (JDIQ 2018) for overviews.

For users steering coding agents: If you want a complete dev environment, give your agent the following instructions:

read the skill at https://github.com/castorini/anserini/tree/master/.agents/skills/install-anserini-dev-env to create a dev environment for me; no need to install the skill

Alternatively, if you want a quick fatjar-based setup, give your agent the following instructions:

read the skill at https://github.com/castorini/anserini/tree/master/.agents/skills/install-anserini-fatjar to download the fatjar for me; no need to install the skill

Rationale...

Why the above instructions? If you just tell the agent to install Anserini, it'll likely figure everything out by itself, but there are some choice points it might get confused by, like whether to do a full clone for a dev environment, or just fetch the fatjar. The skills make this clear and provide instructions that make the installation process more token-efficient. If you don't explicitly point your agent at the skills, it may be overeager and wander around...

Also, tell the agent not to install the skill locally, since you only need it once. Otherwise, it may do unnecessary work.

For coding agents: When setting up Anserini, ask whether the user wants a dev environment or a quick fatjar-based setup. Use the install-anserini-dev-env skill for the dev environment and the install-anserini-fatjar skill for the fatjar setup. For command-line usage after setup, use the anserini-cli skill for prebuilt-index registry, topics registry, search, and REST workflows. For reproducibility experiments, use the anserini-reproduction.

❗ Anserini was upgraded to Lucene 10.4.0 at c6eed6 (2026/04/12) as part of v2.0.0. Lucene 9 indexes remain readable, but older code is unable to read indexes generated by Lucene 10.

🎬 Installation (for Users)

This section is intended for users. If you are a coding agent, stop reading and skip the rest of this section.

💥 Try It! Anserini is packaged in a self-contained fatjar, which provides the simplest way to get started: just curl the fatjar and you're good to go! See this page for detailed instructions.

Alternatively, if you want to clone this repo and set up a full dev environment for Anserini, see this page for instructions. Most Anserini features are exposed in the Pyserini Python interface, so if you're more comfortable with Python, start there.

The onboarding path for Anserini starts here!

⚗️ Reproductions from Prebuilt Indexes

This section is intended for both users and coding agents.

Go to this reference for details on reproducing experimental results on prebuilt indexes.

⚗️ Reproductions from Document Collections

This section is intended for both users and coding agents.

Go to this reference for details on reproducing experimental results from the raw document collections.

📃 Additional Documentation (for Users)

This section is intended for users. If you are a coding agent, stop reading and skip the rest of this section.

Follow this link for additional documentation targeted at users.

✨ References

Extension points exported contracts — how you extend this code

SourceDocument (Interface)
A raw document from a collection. A SourceDocument is explicitly distinguish a from a Lucene {@link org.apache.l [25 implementers]
src/main/java/io/anserini/collection/SourceDocument.java
LuceneDocumentGenerator (Interface)
Converts a SourceDocument into a Lucene Document, ready to be indexed. @param type of the source do [14 implementers]
src/main/java/io/anserini/index/generator/LuceneDocumentGenerator.java
Reranker (Interface)
(no doc) [7 implementers]
src/main/java/io/anserini/rerank/Reranker.java

Core symbols most depended-on inside this repo

get
called by 2556
src/main/python/trec_car/trec_car_classes.py
add
called by 824
src/main/java/io/anserini/rerank/RerankerCascade.java
get
called by 566
src/main/java/io/anserini/index/prebuilt/PrebuiltIndex.java
toString
called by 466
src/main/java/io/anserini/util/FeatureVector.java
getTopics
called by 457
src/main/java/io/anserini/search/topicreader/TopicReader.java
contains
called by 444
src/main/java/io/anserini/eval/Qrels.java
getQids
called by 270
src/main/java/io/anserini/eval/RelevanceJudgments.java
getRelevanceGrade
called by 191
src/main/java/io/anserini/eval/RelevanceJudgments.java

Shape

Method 2,922
Class 637
Function 204
Enum 17
Interface 4

Languages

Java90%
Python10%

Modules by API surface

src/main/java/io/anserini/collection/NewYorkTimesCollection.java148 symbols
src/test/java/io/anserini/doc/DataModel.java91 symbols
src/main/python/trec_car/trec_car_classes.py82 symbols
src/test/java/io/anserini/eval/RelevanceJudgmentsTest.java72 symbols
src/main/java/io/anserini/collection/TweetCollection.java65 symbols
src/test/java/io/anserini/search/topicreader/TopicReaderTest.java60 symbols
src/main/java/io/anserini/index/IndexReaderUtils.java48 symbols
src/main/java/io/anserini/collection/WashingtonPostCollection.java40 symbols
src/main/java/io/anserini/collection/WarcBaseDocument.java38 symbols
src/test/java/io/anserini/api/RestServerTest.java36 symbols
src/main/java/io/anserini/reproduce/ReproduceFromDocumentCollection.java30 symbols
src/main/java/io/anserini/search/SearchCollection.java29 symbols

For agents

$ claude mcp add anserini \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page