Private Document Intelligence — ingest your files and receive grounded, citation-backed answers. Fully offline.
VaultMind combines hybrid retrieval, reranking, and faithfulness guardrails so responses stay tied to your source material. No cloud APIs required after initial model download.
- Multi-format ingestion — PDF, CSV, JSON, TXT, MD, DOCX
- Hybrid retrieval — vector search + BM25 + cross-encoder reranking
- Knowledge graph boost — lightweight entity linking for multi-hop questions
- Grounded answers — citations, relevance grading, and faithfulness checks
- Fully local — LLM, embeddings, vector store, and graph storage on your machine
- CLI + web UI — scriptable commands and a Gradio interface
- Python 3.11+
- Ollama
- Python
venv(recommended) - 16 GB RAM (recommended)
python3 -m venv .venv
source .venv/bin/activate # macOS / Linux
# .venv\Scripts\activate # Windowspip install --upgrade pip
pip install -r requirements.txt
pip install -e .For development (tests):
pip install -e ".[dev]"Download models once while you have network access. These are the defaults:
ollama pull llama3.2:3b
ollama pull nomic-embed-textAlternative models (more capable, higher RAM use):
ollama pull mistral:7b-instruct-q4_K_MIf you change models, update your .env file (see below).
Copy the example environment file and edit as needed:
cp .env.example .envKey variables:
| Variable | Default | Description |
|---|---|---|
OLLAMA_HOST |
http://127.0.0.1:11434 |
Ollama API endpoint |
OLLAMA_MODEL |
llama3.2:3b |
Chat / reasoning model |
OLLAMA_EMBED_MODEL |
nomic-embed-text |
Embedding model |
ENABLE_KG |
true |
Enable knowledge graph extraction on ingest |
local-rag status
pytest tests/Optional end-to-end check (requires Ollama running):
python scripts/smoke_test.pylocal-rag-webOpen http://127.0.0.1:7860 in your browser.
- Upload documents in the Document library panel
- Click Index documents
- Ask questions in the Assistant chat
- Use Limit search to (under Query settings) to scope queries to specific files
- Use Remove selected to delete files from the index
# Index files or directories
local-rag ingest ./docs --collection mydocs
# Single question
local-rag ask "What is the refund policy?" --collection mydocs
# Interactive chat
local-rag chat --collection mydocs
# Check system and index status
local-rag status --json
# Remove specific files from the index
local-rag delete "report.pdf" --collection mydocs
# Wipe an entire collection
local-rag reset --collection mydocsFilter answers to specific files:
local-rag ask "Summarize the policy" --collection mydocs --sources policy.pdfSkip knowledge graph extraction during ingest (faster, vector-only):
local-rag ingest ./docs --no-kgDocuments → loaders → chunking → embeddings → ChromaDB
↘ entity extraction → SQLite + NetworkX
Question → hybrid retrieval (dense + BM25 + KG) → rerank → grade → generate → verify → answer
| Layer | Technology |
|---|---|
| LLM | Ollama |
| Embeddings | Ollama nomic-embed-text (fallback: MiniLM) |
| Vector store | ChromaDB (local persistence) |
| Sparse search | BM25 |
| Reranker | Cross-encoder (ms-marco-MiniLM-L-6-v2) |
| Knowledge graph | SQLite + NetworkX |
| Agent orchestration | LangGraph |
| Web UI | Gradio |
| CLI | Typer |
After Ollama models are pulled, VaultMind runs without internet access. All inference, embedding, indexing, and storage happen on your device. Data is written to the local ./data/ directory.
local-rag-agent/
├── app/ # Gradio web UI (VaultMind)
├── cli/ # Typer CLI entry point
├── src/local_rag/ # Core library (ingestion, retrieval, agent, guardrails)
├── tests/ # Unit tests
├── scripts/ # Smoke test script
├── requirements.txt
├── pyproject.toml
└── .env.example
| Issue | Suggestion |
|---|---|
Ollama not reachable |
Start Ollama: ollama serve |
| Refusal despite indexed docs | Rephrase the question; try unchecking Limit search to; restart the web UI after code updates |
| Slow first ingest | Normal — embeddings and optional KG extraction run locally |
| Out of memory | Use llama3.2:3b instead of a 7B+ model; ingest fewer files at once |
Contributions are welcome. To propose a change:
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-change) - Make your changes and add tests where appropriate
- Run
pytest tests/and ensure they pass - Open a pull request with a clear description of the change
Please keep pull requests focused and include steps to verify the behavior.
If you run into issues or have questions:
- Open a GitHub issue
- Reach out to the maintainer: Shrenik Jain
This project is licensed under the MIT License. See LICENSE for the full text.