Metadata-Version: 2.4
Name: zettabrain-rag
Version: 0.1.1
Summary: Local private RAG pipeline — LangChain + Ollama + ChromaDB + NFS support
Author-email: Olajide <olajide@zettabrain.io>
License: MIT
Project-URL: Homepage, https://github.com/zettabrain-io/zettabrain-rag
Project-URL: Repository, https://github.com/zettabrain-io/zettabrain-rag
Project-URL: Issues, https://github.com/zettabrain-io/zettabrain-rag/issues
Keywords: rag,llm,langchain,ollama,chromadb,local-ai,private-ai,nfs
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: langchain>=0.2.0
Requires-Dist: langchain-community>=0.2.0
Requires-Dist: langchain-ollama>=0.1.0
Requires-Dist: langchain-chroma>=0.1.0
Requires-Dist: langchain-core>=0.2.0
Requires-Dist: langchain-text-splitters>=0.2.0
Requires-Dist: chromadb>=0.5.0
Requires-Dist: pypdf>=4.0.0
Requires-Dist: python-docx>=1.1.0
Requires-Dist: requests>=2.31.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: black>=24.0; extra == "dev"
Requires-Dist: ruff>=0.4.0; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"

# ZettaBrain RAG

**Local private RAG pipeline — your documents, your hardware, zero cloud.**

---

## Install

```bash
pip install zettabrain-rag
```

Requires Python 3.10+ and [Ollama](https://ollama.com).

---

## One-time setup

### 1. Install Ollama and pull models
```bash
curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3.1:8b
ollama pull nomic-embed-text
```

### 2. Mount NFS share and build vector store
```bash
sudo zettabrain-setup
```
Prompts for NFS server IP and export path, mounts at `/mnt/Rag-data`, then builds the vector store automatically.

### 3. Start chatting
```bash
zettabrain-chat
```

---

## Commands

| Command | What it does |
|---|---|
| `sudo zettabrain-setup` | NFS mount wizard + auto vector store build |
| `zettabrain-chat` | Start interactive RAG chat |
| `zettabrain-chat --rebuild` | Rebuild vector store then chat |
| `zettabrain-chat --debug` | Show retrieved chunks on every query |
| `zettabrain-ingest` | Ingest documents without starting chat |
| `zettabrain-ingest --file /path/to/file.pdf` | Ingest a single file |
| `zettabrain-ingest --stats` | Show what's in the vector store |
| `zettabrain-ingest --clear` | Wipe the vector store |
| `zettabrain-status` | Show install paths and store statistics |

---

## Directory structure after install

```
/zettabrain/
├── nfs_setup.sh              ← NFS mount wizard (run via sudo zettabrain-setup)
└── src/
    ├── 03_langchain_rag.py   ← main RAG pipeline
    ├── 05_ingest_documents.py← ingestion utility
    ├── 01_chromadb_setup.py  ← diagnostic: verify ChromaDB
    ├── 02_embeddings_test.py ← diagnostic: verify embeddings
    └── zettabrain_vectorstore/  ← auto-generated, do not commit
```

---

## Configuration via environment variables

```bash
export ZETTABRAIN_DOCS=/mnt/Rag-data          # documents folder (NFS mount)
export ZETTABRAIN_CHROMA=./zettabrain_vectorstore
export ZETTABRAIN_LLM_MODEL=llama3.1:8b
export ZETTABRAIN_EMBED_MODEL=nomic-embed-text
export ZETTABRAIN_CHUNK_SIZE=1500
export OLLAMA_HOST=http://localhost:11434
```

---

## Supported document formats

`.pdf`  `.txt`  `.md`  `.docx`

---

## Hardware guide

| RAM | Model | Notes |
|---|---|---|
| 8GB | llama3.2:3b | Basic |
| 16GB | llama3.1:8b | Recommended |
| 32GB | mistral-nemo:12b | Better reasoning |
| Apple M3/M4 | llama3.1:70b-q4 | Excellent |

---

## License

MIT — © ZettaBrain
