Production-ready RAG with near-zero hallucination. Pluggable providers (OpenAI, Anthropic, Gemini, OpenRouter, Azure, Voyage, ...), graph + agentic + multilingual strategies, a FastAPI server with a bundled React UI, and one-click publishing of a configured setup as a public ask-only assistant.
Project description
A complete RAG system in one pip install: pluggable LLM/embedding providers, four composable retrieval strategies (Simple, Graph, Agentic, Multilingual), a FastAPI server, and a pre-built React UI bundled inside the package. No npm, no Docker, no configuration required for the basic case.
Install and run
pip install "ragzero[all]"
ragzero serve
# → open http://127.0.0.1:8000
That's it. The web UI opens, you paste an API key, upload some documents, and ask questions.
What you get
- 🚫 Near-zero hallucination by design — constrained generation, citation enforcement, refusal-first fallback when evidence is thin
- 🔌 Pluggable providers for both LLMs (Anthropic, OpenAI, Azure, Gemini, OpenRouter) and embeddings (OpenAI, Azure, Gemini, Voyage, OpenRouter, sentence-transformers) — pick any model name, not a hard-coded list
- 🧠 Four RAG strategies, composable: Simple, Graph (vector + entity graph), Agentic (plan → search → reflect), Multilingual (ask in any language, answer in any language)
- 📊 Live progress UI — see chunk-by-chunk embedding progress and graph build progress in real time via SSE
- 👥 Multi-user isolation — each browser session has its own credentials, corpus, and config
- 📣 Publish a public assistant — turn your configured setup into a shareable, ask-only page (
/a/<slug>); visitors only ask and read answers, never seeing your data, models, or keys - 🧪 150 tests covering every pipeline step
Install with the providers you actually use
The base install includes the server and the core library. Provider SDKs are extras:
# Minimal — only mock providers (good for testing)
pip install ragzero
# With one specific provider
pip install "ragzero[openai]" # OpenAI, Azure OpenAI, and OpenRouter
pip install "ragzero[anthropic]" # Claude
pip install "ragzero[gemini]" # Google Gemini
pip install "ragzero[voyage]" # Voyage AI embeddings
pip install "ragzero[local]" # sentence-transformers (local embeddings)
pip install "ragzero[faiss]" # FAISS vector store
pip install "ragzero[graph]" # NetworkX for Graph RAG
# Everything
pip install "ragzero[all]"
Usage
As a CLI tool
ragzero serve --port 8000 # web UI + API
ragzero serve --admin-token SECRET # gate the admin console (see "Publish" below)
ragzero info # which provider SDKs are installed
ragzero query --docs ./my-docs --query "What is RAG?" # one-shot CLI query
ragzero version
As a Python library
from ragzero import build_dev_pipeline, Document
from datetime import datetime, timezone
pipeline = build_dev_pipeline()
pipeline.ingest_documents([
Document(
doc_id="d1",
source="my-notes.txt",
content="The sky is blue because of Rayleigh scattering...",
doc_type="txt",
created_at=datetime.now(timezone.utc),
)
])
answer = pipeline.answer("Why is the sky blue?")
print(answer.text)
print(f"Confidence: {answer.confidence}")
for c in answer.citations:
print(f" - {c.source} (chunk {c.chunk_id})")
For real providers, build the pipeline from YAML:
from ragzero.rag.config import load_pipeline
pipeline = load_pipeline("my_config.yaml", overrides={
"backends": {
"llm": "anthropic",
"llm_settings": {"api_key": "sk-ant-...", "model": "claude-opus-4-7"},
"embedder": "openai",
"embedder_settings": {"api_key": "sk-...", "model": "text-embedding-3-large"},
},
})
The four RAG strategies
| Strategy | Best for |
|---|---|
| Simple | Standard Q&A over well-structured documents |
| Graph | Multi-hop questions ("what companies did X's co-founders work at?") |
| Agentic | Complex questions requiring decomposition + iterative search |
| Multilingual | Cross-language Q&A — wraps any other strategy |
All four compose: Multilingual( Agentic( pipeline ) ) lets you ask in Hindi and have the agent reason in English and return the answer in Hindi.
Publish a public assistant
Once you've connected a model and indexed your data, you can publish a public, ask-only assistant for other people — they only ask questions and read answers, and never see your data, models, keys, or settings.
- Start the server with an admin token so the console is protected:
ragzero serve --admin-token YOUR_SECRET # or set RAGZERO_ADMIN_TOKEN
- In the console, open the Publish tab. Set the name, accent color, welcome message, suggested questions, allowed modes, and whether citations/confidence are shown. Optionally add an access code and tune the per-visitor rate limit + daily cap.
- Click Publish. Share the public link:
http://<host>/a/<slug>.
The public page talks only to a locked-down API (GET /public/meta, POST /public/query)
that returns just the fields you allowed. To share beyond your own machine, bind to all
interfaces (--host 0.0.0.0) for your LAN, use a tunnel (cloudflared tunnel --url http://localhost:8000) for the internet, or run it behind a reverse proxy on a server.
⚠️ Always set
--admin-tokenbefore exposing the server beyondlocalhost— otherwise the admin console (and your data/keys) would be reachable too. The server warns you if you bind to a non-local address without one.
Configuration
The bundled config/dev.yaml is loaded by default. Override with --config or RAGZERO_CONFIG:
ragzero serve --config /etc/ragzero/prod.yaml
# or
RAGZERO_CONFIG=/etc/ragzero/prod.yaml ragzero serve
Key knobs (all editable from the UI's Config tab too):
pipeline:
chunk_size: 1000
chunk_overlap: 150
confidence:
half_life_days: 180 # how fast freshness decays
w_freshness: 0.30
w_source: 0.40
w_consistency: 0.30
fallback:
min_aggregate_confidence: 0.65 # below this → refuse
require_min_citations: 2
Testing
git clone https://github.com/aasu14/ragzero.git
cd ragzero
pip install -e ".[dev,all]"
pytest # 150 tests
python3 run_tests.py # alternative stdlib runner (no pytest)
Security notes
- Session API keys are kept in memory only — never written to disk or logs
- HTTP-only
SameSite=Laxsession cookies - Admin console +
/api/*can be gated with--admin-token/RAGZERO_ADMIN_TOKEN; set it before exposing the server beyondlocalhost - The public assistant has per-visitor rate limiting + a daily cap and an optional access code; the
/public/*API never returns data, models, or keys - A published Space is persisted to
~/.ragzero/space.json(mode0600) and includes the provider credentials from the snapshot — protect that file / the host machine accordingly POST /api/ingest/pathreads server-side filesystem — guard access in production- No built-in CSRF — add tokens if exposing the admin API across origins; for heavy public traffic put nginx/Cloudflare in front
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ragzero-0.1.0.tar.gz.
File metadata
- Download URL: ragzero-0.1.0.tar.gz
- Upload date:
- Size: 198.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e30ad0c013f4771da4484f70563aa029e33070862c48b97c61f9788ff89362fa
|
|
| MD5 |
1d74e52ddf416c3edf4223168b7d3618
|
|
| BLAKE2b-256 |
bb0e57fe00e0d971d45aa5374fa250eeb66a7b10c96a33cd8c9acff163c51f08
|
Provenance
The following attestation bundles were made for ragzero-0.1.0.tar.gz:
Publisher:
publish.yml on aasu14/ragzero
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ragzero-0.1.0.tar.gz -
Subject digest:
e30ad0c013f4771da4484f70563aa029e33070862c48b97c61f9788ff89362fa - Sigstore transparency entry: 1684602658
- Sigstore integration time:
-
Permalink:
aasu14/ragzero@56caaa65a4c3afce03fdbf5ef2c3270aae91cf41 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/aasu14
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@56caaa65a4c3afce03fdbf5ef2c3270aae91cf41 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ragzero-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ragzero-0.1.0-py3-none-any.whl
- Upload date:
- Size: 202.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2173246fc542beb7549dbc17f4d0f6c967ef949651e3631823ad3daff653165
|
|
| MD5 |
4259683a204cc8f05bc76d34c1fe80cd
|
|
| BLAKE2b-256 |
c0537ca4f2de9439be3c3b62eb4224036bf21a2ae87e703ebfa5a75ba769f803
|
Provenance
The following attestation bundles were made for ragzero-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on aasu14/ragzero
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ragzero-0.1.0-py3-none-any.whl -
Subject digest:
e2173246fc542beb7549dbc17f4d0f6c967ef949651e3631823ad3daff653165 - Sigstore transparency entry: 1684603066
- Sigstore integration time:
-
Permalink:
aasu14/ragzero@56caaa65a4c3afce03fdbf5ef2c3270aae91cf41 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/aasu14
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@56caaa65a4c3afce03fdbf5ef2c3270aae91cf41 -
Trigger Event:
push
-
Statement type: