What is AutoRAG?
AutoRAG is a self-evolving librarian agent for document collections. It sits in the RAG Frameworks & Platforms category of the Retrieval & Knowledge (RAG) tools and is open-source, written in TypeScript and licensed MIT (AutoRAG 2.0); Apache-2.0 for the legacy Python package. To get started: install the library or the CLI.
Overview
AutoRAG is a self-evolving librarian agent for document collections. Instead of returning a list of file paths and matching lines and leaving you to open, read and synthesize, it searches your PDFs, wikis, notes, research papers and knowledge bases, reads the source files directly, judges the evidence, and hands back clean numbered knowledge units with their locations.
Two design choices set it apart. First, it never asks you to migrate your data to search it: AutoRAG federates CLI-owned stores in place, with no forced ingestion into a central index and no third-party server holding a copy of your corpus, and results carry source-native identities with scope-checked access. Second, it aims to work without a RAG degree — the local embedder and the MinSync auto-install handle the plumbing, so there is no pipeline tuning, no vector-database operation and no API key to configure.
It supports pluggable retrieval methods — local lexical BM25, semantic vector search and hybrid — all sharing one MinSync CDC chunk lifecycle, with results normalized and deduplicated before the agent curates them. A self-evolving memory records which retrieval methods worked for which kinds of query, which document areas were productive, and what the caller marked as useful, so a seasoned instance narrows its search where a fresh one would try everything.
Note that this repository now hosts AutoRAG 2.0, a complete reimagining of the project. The original Python RAG AutoML tool that automatically searched for an optimal RAG pipeline lives on in the `legacy/` directory and stays in maintenance mode — still installable via `pip install AutoRAG`, still receiving bug fixes and dependency updates.
What it does
- Curated, numbered answers with source locations rather than raw grep dumps
- Searches CLI-owned stores in place — no forced ingestion, no central index, no copy of your corpus elsewhere
- Pluggable retrieval: local BM25, semantic vector and hybrid, merged and deduplicated through one chunk lifecycle
- Self-evolving memory that learns which methods and document areas pay off, guided by explicit feedback
- Local embedder (EmbeddingGemma via Ollama) with auto-installing MinSync — no API keys needed for core search
- Typed `SearchDocumentsResponse` payload for callers, so there is no assistant text to parse
- Interactive `autorag tui` terminal UI (beta) sharing the same config as `autorag search`
Getting started
AutoRAG 2.0 ships as the `@autorag/librarian` npm package and runs on Node 24+ or Bun. PDF parsing additionally requires Java 11 or newer, because the bundled @opendataloader/pdf runtime is compiled for Java 11.
Install the library or the CLI
Add it as a dependency, or install the autorag CLI globally.
bun add @autorag/librarian # library
bun install -g @autorag/librarian # autorag CLICheck your Java runtime if you index PDFs
Verify that the Java that will be picked up from PATH is version 11 or newer. Java 8 is not supported by the PDF parser.
java -versionSearch a folder from code
Construct the agent with the paths to search and call searchDocuments. The call runs the agent loop — search, read, consult memory, curate — and returns a typed response.
import { AutoRAGAgent } from "@autorag/librarian";
const agent = new AutoRAGAgent({
searchPaths: ["/path/to/documents"],
});
const response = await agent.searchDocuments("summarize the compliance requirements");
console.log(response.answer);
for (const result of response.results) {
console.log(`[${result.number}] ${result.title} — ${result.summary}`);
}Teach it what was useful
Report which numbered results helped and which did not. That feedback feeds the self-evolving memory, so the next search on a similar question starts closer to the answer.
agent.recordFeedbackByNumbers(response.sessionId, [1, 3], [2]);Or drive it interactively
The beta TUI uses the same configuration as autorag search; inside it, /resume browses saved sessions.
autorag tuiCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Ask questions across a scattered pile of PDFs, wikis and notes without first building a vector database
- Give an agent search over a corpus that policy says cannot be copied into a third-party index
- Replace grep-style code and document search with answers that cite where each finding came from
- Stand up retrieval for a team that has no one to own RAG pipeline tuning
How AutoRAG compares
AutoRAG alongside other open-source rag frameworks & platforms tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Dify | ★ 162k | An open-source platform with a visual workflow builder for creating LLM and RAG applications without writing much code. |
| graphify | ★ 155k | Turns a folder of code, docs, PDFs and images into a local knowledge graph with tree-sitter AST parsing and Leiden communities — queryable by agents over MCP, no vector store. |
| RAGFlow | ★ 95k | A RAG engine built around deep document understanding that turns complex files into a grounded, citation-backed question-answering layer. |
| Context7 | ★ 65.7k | Context7 pulls current, version-specific documentation and code examples for any library and feeds them into your LLM, available as a CLI skill or an MCP server. |
| Pathway | ★ 61.9k | A Python framework with a Rust streaming engine that keeps ETL, real-time analytics and RAG pipelines continuously up to date as source data changes. |
| LightRAG | ★ 41k | A graph-based RAG system that builds an entity-and-relationship knowledge graph for fast retrieval and easy incremental updates. |
| PageIndex | ★ 40.8k | PageIndex turns long PDFs into a table-of-contents tree and uses LLM reasoning to retrieve relevant sections, with no vector database and no chunking. |
| AutoRAG | ★ 6.2k | A librarian agent that searches your documents in place and returns curated answers |
