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

Sara

Sara is a public Python research implementation for selective, adaptive retrieval-augmented generation with context compression. It compares standard RAG, which places retrieved documents in a prompt as text, with SARA, which combines text passages and compressed retrieval embeddings mapped into a language model’s hidden space by a trained projector.

Independent OpenViST project profile, based on linked sources.

Sara — 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 Sara for local GPU experiments comparing ordinary text-in-context RAG with a method that compresses some retrieved evidence into embeddings, particularly within its documented QASPER workflow.

Who it is for

  • Researchers studying retrieval-augmented generation and context compression
  • Developers building local RAG experiments who want a documented baseline and SARA comparison
  • Teams evaluating retrieval and compression approaches on the QASPER benchmark

Documented uses

  • Prepare document-level QASPER train, development and test splits
  • Fine-tune standard RAG and SARA adapters from the Mistral base
  • Run batched evaluation using the documented methods, retriever and dataset settings
  • Generate a comparison report from RAG and SARA evaluation outputs
  • Optionally warm up the SARA projector by training it to reconstruct documents from compressed embeddings
Before you choose

Requirements & limits

The repository is public and licensed under Apache-2.0. The documented setup targets Python 3.11 and CUDA 12.x. Access to the gated Mistral base requires an HF_TOKEN.

  • The implementation is a research repository, not a hosted service or API.
  • The documented baseline uses Mistral-7B-Instruct-v0.2, QASPER and BM25.
  • Training and evaluation commands are GPU-oriented; the README directs commands to GPU 0 by default.
  • The SARA variant adds a trained projector to LoRA adapters, while standard RAG uses LoRA only.
  • Flash-Attention is optional; the documented default is PyTorch SDPA.

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

Set up Sara’s research environment

Prepare the documented Python environment and install Sara and its dependencies.

Before you start

  • Linux environment with Python 3.11 and CUDA 12.x
  • Conda
  • Access to the gated Mistral base via an HF_TOKEN for later model use

Steps

  1. Create and activate a Python 3.11 Conda environment named sara.

  2. Install PyTorch, torchvision and torchaudio from the cu128 PyTorch wheel index.

  3. Install Sara in editable mode with pip install -e ., or install its requirements file.

Expected outcome

Sara’s documented dependencies are installed in the environment for the subsequent benchmark workflow.

Guide limitations

  • The guide covers installation only; it does not verify successful execution.
  • Model access requires an HF_TOKEN for the gated Mistral base.
  • Flash-Attention is optional; the README says PyTorch SDPA is used by default.
Source-based practical guide

Prepare QASPER splits and train the two benchmark methods

Create the documented QASPER splits and launch fine-tuning for standard RAG and SARA.

Before you start

  • Sara environment installed
  • Python 3.11 and CUDA 12.x with GPU access
  • HF_TOKEN for access to the gated Mistral base

Steps

  1. Create the document-level splits with python -m src.data.make_qasper_splits --dev-frac 0.1 --seed 42.

  2. Launch standard RAG fine-tuning with the Finetune_RAG_qasper_pubbase.yaml configuration.

  3. Launch SARA fine-tuning with the Finetune_SARA_qasper_pubbase.yaml configuration.

Expected outcome

The documented commands prepare QASPER data and start training a standard RAG adapter and a SARA adapter; the latter includes a projector.

Guide limitations

  • The README’s training commands target GPU 0 and do not provide hardware sizing guidance.
  • This recipe stops at fine-tuning; evaluation and reporting are separate CLI stages.
  • The SARA method represents k candidates as text and n − k as compressed embeddings.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
12 October 2026
Original website title
Ahren09/SARA · Official homepage title · retained in its source language