local-rag
100% local RAG for Obsidian, Zotero, and Claude Code — powered by LightRAG + Ollama
A complete, privacy-first RAG stack that runs entirely on your machine. No API keys. No cloud. No data leaves your computer.
Why local-rag?
| local-rag | Cloud RAG | |
|---|---|---|
| Privacy | Your data stays on your machine | Sent to third-party servers |
| Cost | Free after hardware | Per-token API costs |
| Offline | Works without internet | Requires connectivity |
| Latency | Local inference | Network round-trips |
| Customization | Any model via Ollama | Limited to provider models |
Architecture
┌─────────────────────────────────────────────────────┐
│ YOUR DOCUMENTS │
│ Obsidian vault (.md) │ Zotero storage (.pdf) │
└──────────────┬──────────────────────────────────────┘
│ ingestion pipeline (Python)
▼
┌─────────────────────────────────────────────────────┐
│ LIGHTRAG SERVER │
│ • Knowledge graph (entities + relations) │
│ • Vector index (NanoVectorDB) │
│ • LLM: Ollama → qwen2.5:14b │
│ • Embeddings: Ollama → nomic-embed-text │
│ • REST API at http://localhost:9621 │
└──────────────┬──────────────────────────────────────┘
│
┌───────┴───────┐
▼ ▼
┌─────────────┐ ┌──────────────┐
│ Claude Code │ │ Obsidian │
│ (MCP tool) │ │Smart Connect.│
└─────────────┘ └──────────────┘
Quickstart
1. Install Ollama and pull models
# Download Ollama from https://ollama.com
ollama pull qwen2.5:14b # ~8GB — the LLM
ollama pull nomic-embed-text # ~300MB — embeddings
2. Install LightRAG
pip install "lightrag-hku[api]"
3. Clone and configure
git clone https://github.com/Ricardo-Kaminski/local-rag
cd local-rag
cp config.example.yaml config.yaml
# Edit config.yaml with your paths
4. Start the stack
Windows:
start-rag.bat
Linux/macOS:
./start-rag.sh
5. Run initial ingestion
conda activate local-rag
python ingest.py
6. Configure Claude Code MCP
Add to your Claude Code settings.json (~/.claude/settings.json):
"mcpServers": {
"lightrag": {
"command": "python",
"args": ["C:/path/to/local-rag/mcp_server.py"]
}
}
Now use query_rag, insert_document, and rag_health directly in Claude Code.
Install via pip
pip install local-rag-stack
After installation, use the local-rag CLI:
local-rag ingest # index all documents once
local-rag watch # continuous indexing daemon
local-rag start # start LightRAG server + watcher
local-rag mcp # start MCP server (for testing)
Configure Claude Code to use the MCP server (add to ~/.claude/settings.json):
"mcpServers": {
"lightrag": {
"command": "local-rag",
"args": ["mcp"]
}
}
Claude Code Plugin
Install directly from Claude Code:
/plugin install local-rag
MCP Tools (7 total)
| Tool | Description |
|---|---|
query_rag(question, mode?) |
Query the knowledge base. Modes: local, global, hybrid (default) |
insert_document(path) |
Index a specific file by path |
rag_health() |
Check if LightRAG server is running |
list_sources() |
List configured sources with file counts |
get_indexed_documents(limit?) |
List documents already indexed |
delete_document(doc_id) |
Remove a document from the knowledge base |
get_graph_labels() |
List entity types in the knowledge graph |
Using Claude API as LLM (optional)
Use Claude instead of Ollama for RAG responses. In config.yaml:
llm:
provider: "claude"
model: "claude-opus-4-6"
api_key: "" # or set ANTHROPIC_API_KEY env var
Note: Ollama is still required for embeddings (nomic-embed-text). Only the response LLM can be replaced with Claude.
Guides by Use Case
- Obsidian users — query your personal knowledge base
- Zotero users — search your academic PDF library
- Generic documents — any folder of PDFs, Word files, or Markdown
Hardware Requirements
| Component | Minimum | Recommended |
|---|---|---|
| RAM | 8 GB | 16 GB |
| GPU VRAM | 0 (CPU only, slow) | 8 GB (qwen2.5:7b) / 12 GB (qwen2.5:14b) |
| Disk | 10 GB | 20 GB |
Tested on Windows 11 with RTX 3060 12GB. CPU inference works but is significantly slower.
Just want the MCP server?
If you already have a LightRAG instance running, install the standalone MCP package:
pip install lightrag-mcp
See lightrag-mcp for details.
Contributing
See CONTRIBUTING.md. Bug reports and feature requests welcome via GitHub Issues.
License
MIT — see LICENSE
Metadata
Release files for local-rag-stack 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| local_rag_stack-0.1.0.tar.gz | 48.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| local_rag_stack-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 58.3 kB
Release files / local_rag_stack-0.1.0.tar.gz
| Download URL | local_rag_stack-0.1.0.tar.gz |
|---|---|
| Size | 48.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4215a75533ef8eb68a264378f63698e9ad3612fcfb5e2b63422a21fdee89a127
|
|
BLAKE2b-256 checksum How to use checksums |
366bafb8e283be0d381ab47e0b9c734087699c8ebbc321867309f48b4105259a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 30, 2026.
Transparency logRelease files / local_rag_stack-0.1.0-py3-none-any.whl
| Download URL | local_rag_stack-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6a8cf01f2bc8213a1d752f1c24d695d70ada09de8587b9e9469bae391b435b3
|
|
BLAKE2b-256 checksum How to use checksums |
b7dbe3c5a7dc0440415d916e28ccb9038011997b3a08fa9591cc9c36b183caa9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 30, 2026.
Transparency log