# AkariAsai/self-rag

This includes the original implementation of SELF-RAG: Learning to Retrieve, Generate and Critique through self-reflection by Akari Asai, Zeqiu Wu, Yizhong Wang, Avirup Sil, and Hannaneh Hajishirzi.

Repository: https://github.com/AkariAsai/self-rag
Canonical: https://ross.abutalabs.com/products/self-rag
Homepage: https://selfrag.github.io/
Language: Python
License: MIT
License Family: permissive
Last push: 2024-05-25T11:19:17+00:00

## Health v2 (maintenance only)
Score: 27/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 75
- inputs: {"age_days": 1058, "days_push": 830, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2421, forks 227 (observed 2026-08-28T04:06:50.581333+00:00)

## What it is
Original implementation of Self-RAG, a framework that trains a language model to adaptively retrieve passages on demand and critique its own generations via special reflection tokens. It includes training code, inference scripts, and pretrained 7B/13B Llama2-based models released for the ICLR 2024 paper.

## Use cases
- run self-reflective retrieval-augmented generation with adaptive retrieval
- improve factuality of LLM outputs with reflection tokens
- reproduce the Self-RAG ICLR 2024 paper experiments
- fine-tune a language model to decide when to retrieve passages
- generate answers with citations and self-critique
- compare Self-RAG against standard RAG and ChatGPT baselines

## When to choose
- you want adaptive on-demand retrieval instead of always retrieving fixed passages
- you need controllable generation with factuality and citation critique
- you want to reproduce or extend the Self-RAG research
- you can run Llama2-scale models on GPUs with vLLM

## When to avoid
- you need a production-ready plug-and-play RAG pipeline with connectors
- you cannot host 7B/13B models locally
- you want a maintained library with frequent updates and long-term support
- you need retrieval-augmented generation without model fine-tuning

## Facets
- artifact type: library
- maturity: maintenance
- function: rag, llm-inference, machine-learning, search-engine
- domain: large-language-models, artificial-intelligence
- platform: python
- tags: self-rag, reflection-tokens, research-code, llama2, vllm, factuality, adaptive-retrieval, retrieval-augmented-generation, natural-language-processing, gpu, linux

## Member repositories
- AkariAsai/self-rag (main) score 27

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:50.581333+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:33:02.535218+00:00, confidence not recorded.
  - readme: https://github.com/AkariAsai/self-rag (fetched 2026-08-28T04:06:50.581333+00:00, sha fbfed9eb0f22)
  - homepage: https://selfrag.github.io/ (fetched 2026-08-29T10:13:16.072705+00:00, sha ae468f23369e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
