100% local RAG for Obsidian, Zotero, and Claude Code — LightRAG + Ollama + MCP
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file local_rag_stack-0.1.0.tar.gz.
File metadata
- Download URL: local_rag_stack-0.1.0.tar.gz
- Upload date:
- Size: 48.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4215a75533ef8eb68a264378f63698e9ad3612fcfb5e2b63422a21fdee89a127
|
|
| MD5 |
19614660fbb53178143714014fe7004a
|
|
| BLAKE2b-256 |
366bafb8e283be0d381ab47e0b9c734087699c8ebbc321867309f48b4105259a
|
Provenance
The following attestation bundles were made for local_rag_stack-0.1.0.tar.gz:
Publisher:
publish.yml on Ricardo-Kaminski/local-rag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
local_rag_stack-0.1.0.tar.gz -
Subject digest:
4215a75533ef8eb68a264378f63698e9ad3612fcfb5e2b63422a21fdee89a127 - Sigstore transparency entry: 1200768953
- Sigstore integration time:
-
Permalink:
Ricardo-Kaminski/local-rag@3ca559b1e8e342082920967c855c5724c1dd9cc5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Ricardo-Kaminski
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3ca559b1e8e342082920967c855c5724c1dd9cc5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file local_rag_stack-0.1.0-py3-none-any.whl.
File metadata
- Download URL: local_rag_stack-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6a8cf01f2bc8213a1d752f1c24d695d70ada09de8587b9e9469bae391b435b3
|
|
| MD5 |
b89aba49d3fa3f6e7f9e0330221d2a9f
|
|
| BLAKE2b-256 |
b7dbe3c5a7dc0440415d916e28ccb9038011997b3a08fa9591cc9c36b183caa9
|
Provenance
The following attestation bundles were made for local_rag_stack-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Ricardo-Kaminski/local-rag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
local_rag_stack-0.1.0-py3-none-any.whl -
Subject digest:
c6a8cf01f2bc8213a1d752f1c24d695d70ada09de8587b9e9469bae391b435b3 - Sigstore transparency entry: 1200768956
- Sigstore integration time:
-
Permalink:
Ricardo-Kaminski/local-rag@3ca559b1e8e342082920967c855c5724c1dd9cc5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Ricardo-Kaminski
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3ca559b1e8e342082920967c855c5724c1dd9cc5 -
Trigger Event:
push
-
Statement type: