Practical overview
When it fits
Use it when you want to inspect or adapt a research workflow for answering questions over long material, particularly experiments that need to consider both broad context and factual details.
Who it is for
- Researchers studying long-context question answering and retrieval-augmented generation.
- Developers exploring benchmark-based RAG experiments or adapting a documented long-context QA pipeline.
Documented uses
- Prepare standardized datasets for long-context QA experiments.
- Generate instruction data for supervised fine-tuning and build a retrieval index with links from chunks to original text.
- Run documented inference and evaluation examples with selectable RAG, Extractor and Filter components.
Requirements & limits
The repository is public on GitHub. Its documented setup uses pip requirements; FlashAttention 2 is recommended for GPU memory optimization.
- This is a code-based research project, not a hosted question-answering service.
- Fine-tuning instructions rely on the separate LLaMA-Factory project and require configuring its dataset information.
- The README’s example inference commands use CUDA device selection and named models; model configuration and resources are part of the implementation workflow.
- The project documents a specific long-context truncation approach for evaluation: text beyond the model’s processing length is truncated from the middle, preserving the beginning and end.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Prepare LongRAG datasets and a retrieval index
Download the standardized raw data, create instruction data for fine-tuning, and build a HotpotQA retrieval index.
Before you start
- Python environment with the project requirements installed using pip.
- The LongRAG repository and its documented dataset sources.
Steps
Install project dependencies with the command below.
pip install -r requirements.txtRun the command below to download standardized raw datasets into
data/.bash download/raw_data.shFrom
src, run the command below to create processed instruction data.python gen_instruction.py --per_task_num 200 --min_res_tokens 20 --long_ratio 0.2From
src, run the command below to build the retrieval index and chunk-to-text mappings.python gen_index.py --dataset hotpotqa --chunk_size 200 --min_sentence 2 --overlap 2
Expected outcome
Instruction data is saved in `data/train/processed`, and processed retrieval data is saved in `data/corpus/processed`.
Guide limitations
- These steps prepare data only; they do not fine-tune or run a model.
- The README recommends FlashAttention 2 for GPU memory optimization, but does not make it part of the listed basic setup.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 17 October 2026
- Original website title
- QingFei1/LongRAG · Official homepage title · retained in its source language

