Metadata-Version: 2.4
Name: Rag-System
Version: 2.0.0
Summary: A production-quality Retrieval Augmented Generation (RAG) Python Framework.
Author-email: Mohd Musheer <musheerayan@gmail.com>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: llama-index-core
Requires-Dist: llama-index-vector-stores-chroma
Requires-Dist: llama-index-embeddings-huggingface
Requires-Dist: chromadb
Requires-Dist: llama-index-llms-groq
Requires-Dist: pymupdf
Requires-Dist: python-docx
Requires-Dist: openpyxl
Requires-Dist: beautifulsoup4
Requires-Dist: tiktoken
Requires-Dist: python-dotenv
Provides-Extra: groq
Requires-Dist: llama-index-llms-groq; extra == "groq"
Provides-Extra: chroma
Requires-Dist: chromadb; extra == "chroma"
Requires-Dist: llama-index-vector-stores-chroma; extra == "chroma"
Provides-Extra: huggingface
Requires-Dist: llama-index-embeddings-huggingface; extra == "huggingface"
Requires-Dist: sentence-transformers; extra == "huggingface"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: build; extra == "dev"
Provides-Extra: all
Requires-Dist: llama-index-llms-groq; extra == "all"
Requires-Dist: chromadb; extra == "all"
Requires-Dist: llama-index-vector-stores-chroma; extra == "all"
Requires-Dist: llama-index-embeddings-huggingface; extra == "all"
Requires-Dist: sentence-transformers; extra == "all"
Dynamic: license-file

# Rag-System

Rag-System is a Python Retrieval-Augmented Generation framework with persistent
Chroma storage, incremental ingestion, citations, and multi-provider LLM support.

## Install

```bash
pip install Rag-System
```

## Quick start

```python
from Rag_System import RAG

rag = RAG()
rag.ingest("documents")

response = rag.ask("What is Retrieval-Augmented Generation?")
print(response.answer)
for citation in response.citations:
    print(citation.filename, citation.page_number)
```

`ingest` accepts a single file, a folder, a recursive glob, or a list of paths.
Supported formats include PDF, TXT, Markdown, DOCX, CSV, Excel, JSON, HTML, and XML.
Unchanged files are skipped; changed files are re-indexed and missing files are removed.

## Public API

```python
rag.ingest("paper.pdf")
rag.ingest("documents/**/*.pdf")
rag.ingest(["paper.pdf", "manual.md"])
rag.delete("paper.pdf")
rag.update("paper.pdf")
rag.stats()
rag.reset()
rag.compare("Compare these documents")
rag.summarize("Summarize the documents")
```

`RAGResponse` exposes `answer`, `citations`, `sources`, and retrieval statistics.

## Configuration

Constructor options include `provider`, `model`, `embedding_model`, `data_dir`, and
`verbose`. Environment variables can configure the selected provider, model, chunking,
retrieval, and storage settings. For example:

```env
RAG_PROVIDER=groq
GROQ_MODEL=llama-3.3-70b-versatile
GROQ_API_KEY=gsk_...
```

The default client is lazy: construction does not download models or ingest files.
Call `ingest` before `ask`.

## CLI

```bash
rag ingest
rag ask "Which colleges offer MCA?"
rag stats
rag documents
```
