Back to directory

TeaRAG

The source code for a paper on a token-efficient, agentic retrieval-augmented generation framework that compresses both retrieved content and reasoning steps to answer complex queries with fewer tokens and faster reasoning.

TeaRAG

TeaRAG is built on the FlashRAG framework and adds graph-based knowledge retrieval along with a technique the paper calls Iterative Process-aware DPO, aimed at achieving better answers with lower cost in agentic retrieval-augmented generation. The paper, accepted by ACM Transactions on Information Systems, reports exact-match gains of about 4 and 2 percentage points on Llama3-8B-Instruct and Qwen2.5-14B-Instruct respectively, while cutting token usage by roughly 60 percent compared to prior baselines.

The repository includes scripts to prepare data and build a knowledge graph and index, separate training and evaluation pipelines for the two supported base models, and an inference script covering all included datasets, models and baselines; models and the Wikipedia-corpus-based knowledge graph used for training are published on Hugging Face.

It is written in Python and released under the MIT license.

More in RAG

See all 540
  • ai·rete·rag

    ai-rete-rag.com

    A platform that pairs a Rete rule engine with retrieval-augmented generation, so deterministic rules decide an outcome and grounded retrieval explains the decision in plain language.

  • Xtriever

    github.com

    A hybrid retrieval engine for retrieval-augmented generation, written in Rust to run on-device on a phone or a laptop, combining lexical BM25 search, dense embedding search, reciprocal-rank fusion and cross-encoder re-ranking with no server.

  • FileFlux

    github.com

    A .NET library that turns PDF, DOCX, HWP and other documents into optimized chunks for RAG systems, through a five-stage pipeline built on high-performance Rust FFI readers.