Practical overview
When it fits
Use Longrag when you want research code for experimenting with larger retrieval units and long-context reading in a RAG pipeline, especially for question-answering over document collections.
Who it is for
- Researchers studying retrieval-augmented generation with long-context language models.
- Developers prototyping long-document question-answering systems or comparing retrieval-unit sizes.
Documented uses
- Build a prototype that retrieves grouped long documents and uses a long-context reader to answer questions.
- Load the released NQ or HotpotQA retrieval corpus for experiments.
- Prepare a Wikipedia-derived retrieval corpus using the repository's cleaning, processing and grouping scripts.
- Run dense retrieval experiments using the documented Tevatron and bge-large-en-v1.5 setup.
Requirements & limits
The public GitHub repository is licensed under MIT.
- The framework uses retrieval units of about 4,000 tokens, described as roughly 30 times longer than the short units discussed in the README.
- The retrieval code uses Tevatron and bge-large-en-v1.5; its sample script may require local dataset path and GPU-count changes.
- The README names Gemini-1.5-Pro and GPT-4o as long-reader choices.
- The repository includes released retrieval corpora for NQ and HotpotQA, so corpus construction is optional for those datasets.
- The project README says the repository is still being polished.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install the Longrag repository
Clone the code and install its listed Python packages.
Before you start
- Git
- Python and pip
Steps
Clone https://github.com/TIGER-AI-Lab/LongRAG.git.
Change into the LongRAG directory.
Run pip install -r requirements.txt.
Expected outcome
The repository is cloned and its requirements are installed.
Guide limitations
- This covers installation only; the README directs users to the Long Reader section for prediction instructions.
Load a released retrieval corpus
Load the provided NQ or HotpotQA corpus with the Hugging Face datasets library.
Before you start
- Python
- The datasets library
Steps
Import load_dataset from datasets.
Load TIGER-Lab/LongRAG with the nq_corpus configuration for NQ, or hotpot_qa_corpus for HotpotQA.
Expected outcome
The selected released retrieval corpus is available as a dataset object in the Python session.
Guide limitations
- The README documents these retrieval corpus configurations; this does not cover running retrieval or reader inference.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 15 October 2026
- Original website title
- TIGER-AI-Lab/LongRAG · Official homepage title · retained in its source language

