OpenViSTAI · Agents · Blockchain · Crypto
Menu
RAG & Knowledge Systems

Longrag — QingFei1

Longrag — QingFei1 is a Python research implementation of a dual-perspective retrieval-augmented generation approach for answering questions over long-context material. It combines attention to global information with retrieval of factual details and includes documented workflows for dataset preparation, retrieval indexing, model fine-tuning, inference and evaluation.

Independent OpenViST project profile, based on linked sources.

Longrag — QingFei1 — OpenViST project profile in RAG & Knowledge Systems.
OpenViST project illustration. See the linked sources for product details.
Understand the project

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.
Before you choose

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.

Source-based practical guide

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

  1. Install project dependencies with the command below.

    Documented command
    pip install -r requirements.txt
  2. Run the command below to download standardized raw datasets into data/.

    Documented command
    bash download/raw_data.sh
  3. From src, run the command below to create processed instruction data.

    Documented command
    python gen_instruction.py --per_task_num 200 --min_res_tokens 20 --long_ratio 0.2
  4. From src, run the command below to build the retrieval index and chunk-to-text mappings.

    Documented command
    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.
Evidence and transparency

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