Skip to main content

A modular, production-ready Retrieval-Augmented Generation (RAG) pipeline.

Project description

ZeroRAG

Python Code style: ruff License

A modular, production-ready Retrieval-Augmented Generation (RAG) pipeline.

ZeroRAG is a modular, command-line Retrieval-Augmented Generation (RAG) pipeline designed for speed and simplicity. Instead of writing custom boilerplate for every new dataset, ZeroRAG allows you to transform a local folder of complex documents (PDFs, Word files) into a fully embedded vector database with a single command. Once your data is ingested, you can instantly query the database from your terminal to retrieve highly relevant text chunks—providing the perfect context window for LLM generation.

🚀 Install ZeroRAG

ZeroRAG is modular by design. The core package includes basic text processing (.txt) and a lightweight, file-based vector store. To keep your environment clean, you can opt-in to exactly the extra features your pipeline requires.

pip install zerorag

Optional Dependencies

📄 Document Parsers

Extend the core functionality to support additional file formats:

Format Installation Command
PDF pip install "zerorag[pdf]"
Word pip install "zerorag[docx]"

🧠 Embeddings

Use a different embedding provider:

Provider Installation Command
OpenAI pip install "zerorag[openai]"

Note: OpenAI embeddings require an API key. Set the OPENAI_API_KEY environment variable before use. See how to create an API key.

🗄️ Vector Stores

Use a different vector store backend:

Backend Installation Command
ChromaDB pip install "zerorag[chromadb]"

🤖 LLMs

Use an LLM for answer generation with the ask command:

Provider Installation Command
OpenAI pip install "zerorag[openai]"

Note: OpenAI LLMs require an API key. Set the OPENAI_API_KEY environment variable before use. See how to create an API key.

⌨️ CLI Commands

ZeroRAG provides the following commands:

Ingest Documents

This command reads all supported documents from a source directory, splits them into manageable chunks, generates embeddings, and saves the resulting vector database.

Syntax:

zerorag ingest <SOURCE> [OPTIONS]

Arguments:

  • SOURCE (Required): The folder containing your documents.

Options:

  • --types (Default: txt): Comma-separated list of file types to parse (e.g., txt,pdf,docx).
  • --chunk-size (Default: 1200): Maximum number of characters per chunk.
  • --chunk-overlap (Default: 300): Number of overlapping characters between consecutive chunks.
  • --embeddings (Default: fastembed): Embedding provider to use (fastembed, openai-small, or openai-large). The default uses FastEmbed (BAAI/bge-small-en-v1.5) locally with no API key required.
  • --store (Default: inmemory): Vector store backend (inmemory or chromadb).
  • --store-dir (Default: zerorag_store): Directory to persist the vector store.

Note: Parsing non-txt files requires installing the matching optional dependencies.

Example:

$ zerorag ingest ./docs --types txt,pdf --embeddings openai-small --store-dir ./my_store

🚀 Initializing ZeroRAG Ingestion...
   Source    : /home/user/docs
   Formats   : [txt, pdf]
   Embeddings: openai-small
   Store     : inmemory
   Store Dir : /home/user/my_store

📥 Loading documents...
✂️ Chunking documents...
🔢 Initializing embeddings...
💾 Storing vectors...
✅ Ingestion complete!

Query Documents

This command runs a similarity search against a vector store and returns the most relevant document chunks.

Syntax:

zerorag query <QUERY> [OPTIONS]

Arguments:

  • QUERY (Required): The search query.

Options:

  • --embeddings (Default: fastembed): Embedding provider to use (fastembed, openai-small, or openai-large). The default uses FastEmbed (BAAI/bge-small-en-v1.5) locally with no API key required. Must match the provider used during ingestion.
  • --store (Default: inmemory): Vector store backend to load (inmemory or chromadb).
  • --store-dir (Default: zerorag_store): Directory where the vector store was persisted during ingestion.
  • --k (Default: 5): Number of top matching chunks to return.
  • --full: Print the full content of each chunk instead of a truncated preview.

Example:

$ zerorag query "What are the main benefits of RAG?" --store-dir ./my_store --k 2

🔍 Querying vector store...
   Store     : inmemory
   Store Dir : /home/user/my_store
   Top K     : 2

📄 Result 1:
   Source: intro.pdf | Page: 2
   RAG combines retrieval with generation to ground LLM responses in
   real data, reducing hallucinations and improving factual accuracy...

📄 Result 2:
   Source: overview.txt
   The primary benefits include reduced hallucination, up-to-date answers
   from private data, and full traceability back to source documents...

✅ Query complete!

Ask a Question

This command retrieves relevant chunks from a vector store and sends them alongside your question to an LLM, returning a grounded answer based on your documents.

Syntax:

zerorag ask <QUESTION> [OPTIONS]

Arguments:

  • QUESTION (Required): The question to ask.

Options:

  • --llm (Default: openai-mini): LLM to use for generation (openai-mini or openai).
  • --embeddings (Default: fastembed): Embedding provider to use (fastembed, openai-small, or openai-large). The default uses FastEmbed (BAAI/bge-small-en-v1.5) locally with no API key required. Must match the provider used during ingestion.
  • --store (Default: inmemory): Vector store backend to load (inmemory or chromadb).
  • --store-dir (Default: zerorag_store): Directory where the vector store was persisted during ingestion.
  • --k (Default: 5): Number of top matching chunks to retrieve as context.

Note: The ask command requires installing the OpenAI optional dependency.

Example:

$ zerorag ask "What are the main benefits of RAG?" --store-dir ./my_store

🤖 Asking LLM...
   Question  : What are the main benefits of RAG?
   LLM       : openai-mini
   Embeddings: fastembed
   Store     : inmemory
   Store Dir : /home/user/my_store
   Top K     : 5

🔍 Retrieving relevant chunks...
💬 Generating answer...

📝 Answer:
   Based on your documents, the main benefits of RAG are:
   1. Reduced hallucination by grounding responses in real data
   2. Up-to-date answers from private data sources
   3. Full traceability back to source documents

✅ Done!

🐛 Reporting Bugs & Feature Requests

We are constantly looking to improve ZeroRAG. If you encounter a bug or have an idea for a new feature (like a new vector store or document loader), please let us know!

To report a bug or submit a feature request, visit the Issues page.

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

zerorag-0.1.0.tar.gz (234.3 kB view details)

Uploaded Source

Built Distribution

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

zerorag-0.1.0-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file zerorag-0.1.0.tar.gz.

File metadata

  • Download URL: zerorag-0.1.0.tar.gz
  • Upload date:
  • Size: 234.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for zerorag-0.1.0.tar.gz
Algorithm Hash digest
SHA256 13e8bc615102c7ec53b6d861050e0a6708147cf3667d6ffc07a0dd71b77f27e1
MD5 f3bace552b619e69567c0c54d331df47
BLAKE2b-256 b063a5d1aa44fcc8e6474b08dc85233f75b4c558a8fea3aa9a34a3954bdb2a6c

See more details on using hashes here.

File details

Details for the file zerorag-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zerorag-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for zerorag-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c26705772280da01e4be4a22b69469d57d0caa7d3f293d4a3a800793262e0cba
MD5 f4e6bd289c86b49cb1fb6970eef2a453
BLAKE2b-256 70621973a9b782b35f4d8c0cb7238ffa30cdc98596ab605036ef1ecad615b967

See more details on using hashes here.

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