The implementation for SIGIR 2026: Learning to Retrieve from Agent Trajectories.
See the codeRetrieval is no longer optimized only for human searchers. As large language model agents increasingly issue queries, inspect snippets, browse documents, and reason over retrieved evidence, the target of retrieval training has shifted from human interaction to agent interaction. LRAT studies this paradigm shift and learns retrievers directly from multi-step agent trajectories.
Training data for agent native search should match how search agents actually search, browse, and consume evidence.
2026/08/06: Released the CCIR-B BrowseComp-Plus multi-model inference code, including the 50-call autonomous-agent contract.2026/07/01: Organized a competition at CCIR CUP based on LRAT. Welcome!2026/04/08: Released the full paper on arXiv.2026/04/03: Paper accepted to SIGIR 2026.2026/03/24: Open-sourced model checkpoints and the LRAT-Train dataset.LRAT studies how to train retrievers from the intermediate behaviors of strong search agents rather than from only final answers. The repository focuses on a practical pipeline for:
For Chinese readers, we provide an unofficial Chinese walkthrough of LRAT covering the motivation, methodology, and experimental findings:
(query, pos, neg, ...) training pairs with reasoning-aware annotations.BrowseComp-Plus and InfoSeek-Eval with a local vLLM judge.| Resource | Status |
|---|---|
| Homepage | Homepage |
| Model Checkpoint | LRAT Collection |
| Dataset Release | LRAT-Train |
| Paper | arXiv · Accepted by SIGIR 2026 |
The released LRAT-Train dataset contains only completed trajectories with correct final answers.
| Retriever | # Trajectories | Avg. Search | Avg. Browse | Avg. Steps |
|---|---|---|---|---|
| BM25 | 7,674 | 9.15 | 2.96 | 12.11 |
| Qwen3-Embedding-0.6B | 5,913 | 12.81 | 3.68 | 16.49 |
| Qwen3-Embedding-4B | 6,354 | 13.24 | 4.11 | 17.34 |
| Qwen3-Embedding-8B | 6,541 | 11.86 | 3.69 | 15.55 |
| Total | 26,482 | 11.77 | 3.61 | 15.38 |
| Path | Description |
|---|---|
src/ | Core utilities for index construction and trajectory-to-training-data conversion |
search_agent/ | Agent clients for Tongyi DeepResearch, WebExplorer, AgentCPM, OpenAI-compatible APIs, and related prompts/utilities |
searcher/ | Search backends and local retrieval interfaces |
docs/ | Step-by-step documentation for indexing, trajectory construction, training data construction, and evaluation |
datasets/ | Benchmark files used in evaluation |
topics-qrels/ | Query and qrel files for retrieval experiments |
trajectory/ | Example trajectory artifacts |
FlagEmbedding/ | Local copy of FlagEmbedding used for retriever training |
tevatron/ | Local copy of Tevatron utilities used in dense retrieval workflows |
scripts_evaluation/ | Evaluation scripts for end-to-end judging |
ccir_a_leaderboard_eval/ | CCIR A-leaderboard retriever evaluation |
ccir_b_leaderboard_inference/ | CCIR B-test inference for DeepSeek-V4-Flash, GPT-OSS-120B, and Qwen3.5 over six retrievers |
FlagEmbedding/ is a vendored and locally modified copy based on the upstream FlagEmbedding project. In this repository, it reflects user-side modifications layered on top of upstream work and earlier external changes.tevatron/ is a vendored upstream dependency used to support dense retrieval utilities and encoding workflows.bm25faissAlibaba-NLP/Tongyi-DeepResearch-30B-A3Bhkust-nlp/WebExplorer-8Bopenbmb/AgentCPM-Exploreopenai/gpt-oss-120bThe quickest way to understand the repository is:
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Sync environment
uv sync
# Optional: activate the environment
source .venv/bin/activate
# Install flash-attn if needed by your environment
uv pip install --no-build-isolation flash-attn
Install Java 21 for the Lucene / Pyserini-based BM25 pipeline:
conda install -c conda-forge openjdk=21
Install the local FlagEmbedding package:
cd FlagEmbedding
pip install -e .
cd ..
See docs/index_construction.md for the full indexing notes.
BM25 template:
python src/index_builder.py \
--retrieval_method bm25 \
--corpus_path /path/to/your/corpus.jsonl \
--save_dir /path/to/save/index
Dense embedding template via Tevatron:
CUDA_VISIBLE_DEVICES=0 python -m tevatron.retriever.driver.encode \
--model_name_or_path /path/to/your/embedding_model \
--dataset_path /path/to/your/corpus.jsonl \
--encode_output_path /path/to/save/embeddings.pkl \
--passage_max_len 512 \
--normalize \
--pooling <eos|mean> \
--passage_prefix "" \
--per_device_eval_batch_size 512 \
--padding_side left \
--fp16
See docs/trajectory_construction.md for full examples.
Example with Tongyi and a bm25 backend:
python search_agent/tongyi_client.py \
--output-dir /path/to/output/dir \
--searcher-type bm25 \
--index-path /path/to/bm25/index/dir \
--num-threads 32 \
--model /path/to/agent_or_llm_dir \
--snippet-max-tokens 64 \
--query /path/to/queries.tsv \
--port <PORT> \
--k 10
Example with Tongyi and a faiss backend:
python search_agent/tongyi_client.py \
--output-dir /path/to/output/dir \
--searcher-type faiss \
--index-path "/path/to/embeddings/index-*.pkl" \
--model-name /path/to/embedding/model \
--pooling <mean|eos> \
--normalize \
--num-threads 32 \
--snippet-max-tokens 64 \
--query /path/to/queries.tsv \
--port <PORT> \
--dataset-name /path/to/corpus_or_dataset \
--model /path/to/agent_or_llm_dir \
--k 10
See docs/training_data_construction.md.
If you do not want to build training data from scratch, you can directly use the released LRAT-Train dataset. If you prefer to control filtering or supervision design yourself, you can also start from saved agent trajectories and rerun pair extraction with src/data_builder.py.
python src/data_builder.py \
--corpus-path /path/to/your/corpus.jsonl \
--traj-dir /path/to/your/trajectory_dir \
--output-path /path/to/save/output.jsonl \
--tokenizer-path /path/to/your/tokenizer_or_model_dir \
--judge-api-url http://<JUDGE_HOST>:<PORT>/v1/chat/completions \
--judge-model <JUDGE_MODEL_NAME> \
--max-workers 32 \
--future-timeout 30
The repository currently uses the local FlagEmbedding training recipe. Start from:
You can plug the JSONL generated by src/data_builder.py into your existing training setup without changing the repository-level presentation structure.
See docs/evaluate.md.
python scripts_evaluation/evaluate.py \
--input_dir /path/to/agent_output_json_dir \
--gt_path /path/to/InfoSeek-Eval.tsv \
--dataset_type InfoSeek-Eval \
--output_file /path/to/save/eval_results.json \
--model_path /path/to/local_judge_model \
--tensor_parallel_size <NUM_GPUS> \
--gpu_memory_utilization <GPU_MEM_UTIL> \
--batch_size 32
The competition-specific code is kept separate from the core LRAT pipeline:
The B-test runner evaluates all six configured retrievers with autonomous
search/get_document tool use and an explicit upper bound of 50 model
calls per trajectory.
| Topic | Link |
|---|---|
| Index Construction | docs/index_construction.md |
| Trajectory Construction | docs/trajectory_construction.md |
| Training Data Construction | docs/training_data_construction.md |
| Minimal Reproduction | docs/minimal_repro.md |
| Evaluation | docs/evaluate.md |
| Topic | Link |
|---|---|
| Experiment Layout | docs/advanced/experiment_layout.md |
| Segmented Training Data Experiments | docs/advanced/segmented_training_data_experiment.md |
datasets/.topics-qrels/.trajectory/.This repository builds on and benefits from several excellent open-source projects and public resources:
This repository is released under the Apache License 2.0. See LICENSE.
Vendored components keep their own upstream licenses, especially:
FlagEmbedding/ under its upstream MIT licensetevatron/ under Apache License 2.0If you find this repository useful, please cite our SIGIR 2026 paper below. The latest public version is available on arXiv.
@inproceedings{zhou2026lrat,
title={Learning to Retrieve from Agent Trajectories},
author={Zhou, Yuqi and Dai, Sunhao and Qu, Changle and Pang, Liang and Xu, Jun and Wen, Ji-Rong},
booktitle={Proceedings of the 49th International ACM SIGIR Conference on Research and Development in Information Retrieval},
year={2026}
}
Python
94.9%
Shell
4.6%
The implementation for SIGIR 2026: Learning to Retrieve from Agent Trajectories.
See the codeRetrieval is no longer optimized only for human searchers. As large language model agents increasingly issue queries, inspect snippets, browse documents, and reason over retrieved evidence, the target of retrieval training has shifted from human interaction to agent interaction. LRAT studies this paradigm shift and learns retrievers directly from multi-step agent trajectories.
Training data for agent native search should match how search agents actually search, browse, and consume evidence.
2026/08/06: Released the CCIR-B BrowseComp-Plus multi-model inference code, including the 50-call autonomous-agent contract.2026/07/01: Organized a competition at CCIR CUP based on LRAT. Welcome!2026/04/08: Released the full paper on arXiv.2026/04/03: Paper accepted to SIGIR 2026.2026/03/24: Open-sourced model checkpoints and the LRAT-Train dataset.LRAT studies how to train retrievers from the intermediate behaviors of strong search agents rather than from only final answers. The repository focuses on a practical pipeline for:
For Chinese readers, we provide an unofficial Chinese walkthrough of LRAT covering the motivation, methodology, and experimental findings:
(query, pos, neg, ...) training pairs with reasoning-aware annotations.BrowseComp-Plus and InfoSeek-Eval with a local vLLM judge.| Resource | Status |
|---|---|
| Homepage | Homepage |
| Model Checkpoint | LRAT Collection |
| Dataset Release | LRAT-Train |
| Paper | arXiv · Accepted by SIGIR 2026 |
The released LRAT-Train dataset contains only completed trajectories with correct final answers.
| Retriever | # Trajectories | Avg. Search | Avg. Browse | Avg. Steps |
|---|---|---|---|---|
| BM25 | 7,674 | 9.15 | 2.96 | 12.11 |
| Qwen3-Embedding-0.6B | 5,913 | 12.81 | 3.68 | 16.49 |
| Qwen3-Embedding-4B | 6,354 | 13.24 | 4.11 | 17.34 |
| Qwen3-Embedding-8B | 6,541 | 11.86 | 3.69 | 15.55 |
| Total | 26,482 | 11.77 | 3.61 | 15.38 |
| Path | Description |
|---|---|
src/ | Core utilities for index construction and trajectory-to-training-data conversion |
search_agent/ | Agent clients for Tongyi DeepResearch, WebExplorer, AgentCPM, OpenAI-compatible APIs, and related prompts/utilities |
searcher/ | Search backends and local retrieval interfaces |
docs/ | Step-by-step documentation for indexing, trajectory construction, training data construction, and evaluation |
datasets/ | Benchmark files used in evaluation |
topics-qrels/ | Query and qrel files for retrieval experiments |
trajectory/ | Example trajectory artifacts |
FlagEmbedding/ | Local copy of FlagEmbedding used for retriever training |
tevatron/ | Local copy of Tevatron utilities used in dense retrieval workflows |
scripts_evaluation/ | Evaluation scripts for end-to-end judging |
ccir_a_leaderboard_eval/ | CCIR A-leaderboard retriever evaluation |
ccir_b_leaderboard_inference/ | CCIR B-test inference for DeepSeek-V4-Flash, GPT-OSS-120B, and Qwen3.5 over six retrievers |
FlagEmbedding/ is a vendored and locally modified copy based on the upstream FlagEmbedding project. In this repository, it reflects user-side modifications layered on top of upstream work and earlier external changes.tevatron/ is a vendored upstream dependency used to support dense retrieval utilities and encoding workflows.bm25faissAlibaba-NLP/Tongyi-DeepResearch-30B-A3Bhkust-nlp/WebExplorer-8Bopenbmb/AgentCPM-Exploreopenai/gpt-oss-120bThe quickest way to understand the repository is:
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Sync environment
uv sync
# Optional: activate the environment
source .venv/bin/activate
# Install flash-attn if needed by your environment
uv pip install --no-build-isolation flash-attn
Install Java 21 for the Lucene / Pyserini-based BM25 pipeline:
conda install -c conda-forge openjdk=21
Install the local FlagEmbedding package:
cd FlagEmbedding
pip install -e .
cd ..
See docs/index_construction.md for the full indexing notes.
BM25 template:
python src/index_builder.py \
--retrieval_method bm25 \
--corpus_path /path/to/your/corpus.jsonl \
--save_dir /path/to/save/index
Dense embedding template via Tevatron:
CUDA_VISIBLE_DEVICES=0 python -m tevatron.retriever.driver.encode \
--model_name_or_path /path/to/your/embedding_model \
--dataset_path /path/to/your/corpus.jsonl \
--encode_output_path /path/to/save/embeddings.pkl \
--passage_max_len 512 \
--normalize \
--pooling <eos|mean> \
--passage_prefix "" \
--per_device_eval_batch_size 512 \
--padding_side left \
--fp16
See docs/trajectory_construction.md for full examples.
Example with Tongyi and a bm25 backend:
python search_agent/tongyi_client.py \
--output-dir /path/to/output/dir \
--searcher-type bm25 \
--index-path /path/to/bm25/index/dir \
--num-threads 32 \
--model /path/to/agent_or_llm_dir \
--snippet-max-tokens 64 \
--query /path/to/queries.tsv \
--port <PORT> \
--k 10
Example with Tongyi and a faiss backend:
python search_agent/tongyi_client.py \
--output-dir /path/to/output/dir \
--searcher-type faiss \
--index-path "/path/to/embeddings/index-*.pkl" \
--model-name /path/to/embedding/model \
--pooling <mean|eos> \
--normalize \
--num-threads 32 \
--snippet-max-tokens 64 \
--query /path/to/queries.tsv \
--port <PORT> \
--dataset-name /path/to/corpus_or_dataset \
--model /path/to/agent_or_llm_dir \
--k 10
See docs/training_data_construction.md.
If you do not want to build training data from scratch, you can directly use the released LRAT-Train dataset. If you prefer to control filtering or supervision design yourself, you can also start from saved agent trajectories and rerun pair extraction with src/data_builder.py.
python src/data_builder.py \
--corpus-path /path/to/your/corpus.jsonl \
--traj-dir /path/to/your/trajectory_dir \
--output-path /path/to/save/output.jsonl \
--tokenizer-path /path/to/your/tokenizer_or_model_dir \
--judge-api-url http://<JUDGE_HOST>:<PORT>/v1/chat/completions \
--judge-model <JUDGE_MODEL_NAME> \
--max-workers 32 \
--future-timeout 30
The repository currently uses the local FlagEmbedding training recipe. Start from:
You can plug the JSONL generated by src/data_builder.py into your existing training setup without changing the repository-level presentation structure.
See docs/evaluate.md.
python scripts_evaluation/evaluate.py \
--input_dir /path/to/agent_output_json_dir \
--gt_path /path/to/InfoSeek-Eval.tsv \
--dataset_type InfoSeek-Eval \
--output_file /path/to/save/eval_results.json \
--model_path /path/to/local_judge_model \
--tensor_parallel_size <NUM_GPUS> \
--gpu_memory_utilization <GPU_MEM_UTIL> \
--batch_size 32
The competition-specific code is kept separate from the core LRAT pipeline:
The B-test runner evaluates all six configured retrievers with autonomous
search/get_document tool use and an explicit upper bound of 50 model
calls per trajectory.
| Topic | Link |
|---|---|
| Index Construction | docs/index_construction.md |
| Trajectory Construction | docs/trajectory_construction.md |
| Training Data Construction | docs/training_data_construction.md |
| Minimal Reproduction | docs/minimal_repro.md |
| Evaluation | docs/evaluate.md |
| Topic | Link |
|---|---|
| Experiment Layout | docs/advanced/experiment_layout.md |
| Segmented Training Data Experiments | docs/advanced/segmented_training_data_experiment.md |
datasets/.topics-qrels/.trajectory/.This repository builds on and benefits from several excellent open-source projects and public resources:
This repository is released under the Apache License 2.0. See LICENSE.
Vendored components keep their own upstream licenses, especially:
FlagEmbedding/ under its upstream MIT licensetevatron/ under Apache License 2.0If you find this repository useful, please cite our SIGIR 2026 paper below. The latest public version is available on arXiv.
@inproceedings{zhou2026lrat,
title={Learning to Retrieve from Agent Trajectories},
author={Zhou, Yuqi and Dai, Sunhao and Qu, Changle and Pang, Liang and Xu, Jun and Wen, Ji-Rong},
booktitle={Proceedings of the 49th International ACM SIGIR Conference on Research and Development in Information Retrieval},
year={2026}
}
Python
94.9%
Shell
4.6%