Skip to main content

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

ragzero

Production-ready RAG with near-zero hallucination — install and run in 60 seconds.

PyPI version Python 3.10+ License: MIT Tests

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.

  1. Start the server with an admin token so the console is protected:
    ragzero serve --admin-token YOUR_SECRET        # or set RAGZERO_ADMIN_TOKEN
    
  2. 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.
  3. 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-token before exposing the server beyond localhost — 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=Lax session cookies
  • Admin console + /api/* can be gated with --admin-token / RAGZERO_ADMIN_TOKEN; set it before exposing the server beyond localhost
  • 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 (mode 0600) and includes the provider credentials from the snapshot — protect that file / the host machine accordingly
  • POST /api/ingest/path reads 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ragzero-0.1.0.tar.gz (198.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ragzero-0.1.0-py3-none-any.whl (202.9 kB view details)

Uploaded Python 3

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

Hashes for ragzero-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e30ad0c013f4771da4484f70563aa029e33070862c48b97c61f9788ff89362fa
MD5 1d74e52ddf416c3edf4223168b7d3618
BLAKE2b-256 bb0e57fe00e0d971d45aa5374fa250eeb66a7b10c96a33cd8c9acff163c51f08

See more details on using hashes here.

Provenance

The following attestation bundles were made for ragzero-0.1.0.tar.gz:

Publisher: publish.yml on aasu14/ragzero

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for ragzero-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2173246fc542beb7549dbc17f4d0f6c967ef949651e3631823ad3daff653165
MD5 4259683a204cc8f05bc76d34c1fe80cd
BLAKE2b-256 c0537ca4f2de9439be3c3b62eb4224036bf21a2ae87e703ebfa5a75ba769f803

See more details on using hashes here.

Provenance

The following attestation bundles were made for ragzero-0.1.0-py3-none-any.whl:

Publisher: publish.yml on aasu14/ragzero

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page