Docs/AgenticRAG
Open Source · MIT License

AgenticRAG Documentation

Vectorless, reasoning-based RAG for Python. No vector DB, no chunking, no embeddings — just pure LLM reasoning over your documents.

Installation

Terminal
pip install agentic-rag-core

Optional extras:

pip install agentic-rag-core[web]    # Web UI (FastAPI server)
pip install agentic-rag-core[gcs]    # Google Cloud Storage
pip install agentic-rag-core[neo4j]  # Neo4j graph backend
pip install agentic-rag-core[all]    # Everything

Quick Start

Step 1: Get a free API key from console.groq.com

Step 2: Set your API key in a .env file:

GROQ_API_KEY=gsk_your_key_here

Step 3: Ask questions about any PDF — three lines of code:

Python
from agenticrag import Forest

forest = Forest(verbose=True)
forest.add("report.pdf")

result = forest.ask("What was the net income?")
print(result.text)

Web UI

AgenticRAG includes a browser-based chat interface:

pip install agentic-rag-core[web]
python -m agenticrag serve

Opens at http://localhost:8000 — upload PDFs, chat with documents, switch between Groq/Gemini/local LLMs.

API Reference

Classes

ClassWhat it doesWhen to use
ForestMulti-document knowledge baseMost common — use for everything
PageIndexSingle-document indexWhen you only have one document
ForestResultResult from Forest.ask()Access .text, .sources, .confidence

Forest Methods

MethodDescription
.add("file.pdf")Add a single document
.add_directory("./docs/")Add all PDFs from a folder
.add_directory_batch("./docs/")Fast batch add (100+ docs)
.ask("question")Ask a question across all docs
.documents()List all indexed documents
.remove(doc_id)Remove a document
.clear_history()Reset conversation memory
.info()Forest status summary

ForestResult Fields

FieldTypeDescription
.textstrThe final verified answer
.confidencefloat0.0 to 1.0 confidence score
.sourceslistWhich documents/pages were used
.reasoning_tracelistStep-by-step agent pipeline trace
.was_rewrittenboolWhether the Critic modified the answer
.hallucinationslistHallucinations that were caught
.elapsed_secondsfloatTotal time taken

Supported Models

Cloud (Groq — Free API)

from agenticrag import Forest, GroqModel

forest = Forest(model=GroqModel.GPT_OSS_20B)       # Fast, recommended
forest = Forest(model=GroqModel.GPT_OSS_120B)       # Largest, best reasoning
forest = Forest(model=GroqModel.LLAMA4_SCOUT)        # Llama 4 Scout
forest = Forest(model=GroqModel.QWEN3_32B)           # Qwen 3 32B

Local (Ollama — 100% Free)

ollama pull qwen3:4b   # 2.5 GB — recommended

from agenticrag import Forest, LocalModel

forest = Forest(
    model=LocalModel.QWEN3_4B,
    base_url="http://localhost:11434/v1",
)
ModelSizeVRAMBest For
QWEN3_4B2.5 GB≤5 GBLow-VRAM, fastest
QWEN3_8B5.2 GB≤8 GBBest quality/size ratio
QWEN3_14B9.3 GB≤12 GBHigher quality
QWEN3_30B19 GB≤24 GBStrong reasoning
LLAMA3_2_3B2.0 GB≤4 GBUltra-lightweight
MISTRAL4.1 GB≤6 GBGeneral purpose

How It Works

AgenticRAG uses a multi-agent pipeline — like a team of AI researchers working together:

1Planner

Examines the document graph to find which documents might have the answer

2Hunters

Search documents IN PARALLEL using tree-based reasoning

3Synthesizer

Combines evidence from multiple docs into a coherent answer

4Critic

Checks every claim against source text — removes unverified claims

✓ Verified Answer