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.2.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.2.0
File Size Uploaded Provenance Actions
ezrag_engine-0.2.0.tar.gz 5.5 kB Without provenance Details for ezrag_engine-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 11.0 kB

Release files / ezrag_engine-0.2.0.tar.gz

Download URL ezrag_engine-0.2.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1a683328797f3c9f2ec5f924dc15980f08bad0ccff6c4300ae4b10deb2174982
BLAKE2b-256 checksum
How to use checksums
398fb2d4a5c0750886e8206d66a039b01bdd10211d1a17038f5a62934afd475c
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.2.0-py3-none-any.whl

Download URL ezrag_engine-0.2.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70bb164a6b5f779b29635535d6256589e7ff84c4d3fd15e1731a7aacae70d994
BLAKE2b-256 checksum
How to use checksums
fb2cf7ed1138aa9ecfb1654bd6dac20fd618f59439fe5d2d19db5fc243c7b218
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.2.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.2.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