Skip to main content

ezrag — 3-Line, Zero-Boilerplate, Cloud-Ready RAG

A production-grade Retrieval-Augmented Generation framework for Python and Hugging Face Spaces.

PyPI Python PyPI - License


Why ezrag?

Most RAG stacks take hours to wire up: embedding models, vector stores, chunkers, prompts, and LLM clients. ezrag hides all of that behind one class, so you go from an empty folder to a grounded, citation-aware answer in exactly three lines of code.

What you get out of the box:

  • Chunking — sentence-aware splitting with a sliding overlap, zero configuration
  • Embeddings — a lightweight sentence-transformers model, loaded lazily
  • Vector DB — a self-contained in-memory store with fast NumPy cosine search
  • Context bundling — evidence is ranked, tagged [1] [2] [3] ... and injected into the prompt
  • LLM execution — unified calls through the Hugging Face Serverless API or LiteLLM
  • Weak-evidence guard — answers truthfully when the documents do not cover the question

Installation

pip install ezrag

Quick Start

That is the entire experience — import, load, ask:

from ezrag import EZRAG                     # 1. import

rag = EZRAG().load(SOURCE)                  # 2. initialise + load your source
print(rag.ask("Your question here"))        # 3. ask — grounded, cited answer

No environment variables to set up, no vector database to spin up, no prompting prompts to craft. One object call chain produces a grounded, cited answer.

Configuration

Parameter Default Purpose
llm mistralai/Mistral-7B-Instruct-v0.2 LLM identifier or endpoint
embedding_model all-MiniLM-L6-v2 sentence-transformers model
provider "hf" "hf" (HF Serverless) or "litellm"
hf_token env HF_TOKEN token for protected / gated models
top_k 4 number of evidence chunks retrieved
min_score 0.10 retrieval similarity floor
chunk_size 900 target chunk length (characters)
chunk_overlap 120 sliding context overlap

Providers

  • Hugging Face Serverless (default) — no custom API wiring. Set the HF_TOKEN environment variable only when the model is gated.
  • LiteLLM — point llm at any OpenAI-compatible endpoint, for example openai/gpt-4o or azure/gpt-4o.

How It Works

  source ──▶ chunk ──▶ embed ──▶ in-memory index
                                       │
  question ──▶ embed ──▶ top-k search ──┘
                                       │
                      context bundle ──▶ LLM ──▶ cited answer

Hugging Face Spaces

ezrag runs out of the box in a Hugging Face Space — pip pulls in every runtime dependency automatically. Store a HF_TOKEN Space secret if your chosen model is gated.

License

MIT © Oguru Vinay Reddy

Metadata

Release files for ezrag-engine 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ezrag-engine 0.1.0
File Size Uploaded Provenance Actions
ezrag_engine-0.1.0.tar.gz 7.4 kB Without provenance Details for ezrag_engine-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ezrag-engine 0.1.0
File Interpreter ABI Platform Actions
ezrag_engine-0.1.0-py3-none-any.whl Python 3 none any Details for ezrag_engine-0.1.0-py3-none-any.whl

Total release size: 15.0 kB

Release files / ezrag_engine-0.1.0.tar.gz

Download URL ezrag_engine-0.1.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9b163a8e034478219de5b71b79e26d8a440d0decf01c8707a68e695f1b18a12f
BLAKE2b-256 checksum
How to use checksums
e683540106500e7b5d6cad4d8b588ec165b7eafc3c9a465393c2f6f6ae1e4a95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.5

Release files / ezrag_engine-0.1.0-py3-none-any.whl

Download URL ezrag_engine-0.1.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a19abe05319a364ecba3e1b03867a6388c3ec08b51f38b763e6c608bd23ffd73
BLAKE2b-256 checksum
How to use checksums
84789dca95431bb5f70aa764c2988cac70efe624696026586841528b85ffe971
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.5

Security for ezrag-engine 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page