RAG system for querying Obsidian notes using LangGraph and local LLMs
Project description
ObsidianRAG Backend
The Python backend for ObsidianRAG - a RAG system for querying Obsidian notes using LangGraph and local LLMs.
Installation
For Users (via Obsidian Plugin)
The plugin handles installation automatically. If you need to install manually:
pip install obsidianrag
For Developers
We use uv for fast, reliable dependency management:
# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and setup
git clone https://github.com/Vasallo94/ObsidianRAG.git
cd ObsidianRAG/backend
# Install dependencies (creates virtual environment automatically)
uv sync
# Install with dev dependencies
uv sync --dev
# Run commands via uv
uv run obsidianrag serve --vault /path/to/vault
uv run pytest tests/ -v
Quick Start
As a CLI
# Start the server
obsidianrag serve --vault /path/to/your/vault
# Index/reindex the vault
obsidianrag index --vault /path/to/your/vault
# Check status
obsidianrag status
# Ask a question directly
obsidianrag ask "What are my notes about Python?"
As a Library
from obsidianrag import ObsidianRAG
# Initialize with your vault path
rag = ObsidianRAG(vault_path="/path/to/your/vault")
# Ask questions
answer, sources = rag.ask("What are my notes about Python?")
print(answer)
# Get vault stats
stats = rag.get_stats()
print(f"Total notes: {stats['total_notes']}")
Requirements
- Python 3.11+
- Ollama running locally with at least one LLM model
Configuration
Environment variables (prefix with OBSIDIANRAG_ for settings):
| Variable | Default | Description |
|---|---|---|
OBSIDIAN_PATH |
- | Path to your Obsidian vault |
LLM_MODEL |
gemma3 |
Ollama model to use |
EMBEDDING_PROVIDER |
huggingface |
huggingface or ollama |
USE_RERANKER |
true |
Enable CrossEncoder reranking |
CHUNK_SIZE |
1500 |
Text chunk size for indexing |
API Endpoints
When running the server:
| Endpoint | Method | Description |
|---|---|---|
/ask |
POST | Ask a question, returns answer + sources |
/health |
GET | System status, model info |
/stats |
GET | Vault statistics |
/rebuild_db |
POST | Force reindex all notes |
Development
cd backend
# Run tests
uv run pytest tests/ -v
# Run with coverage
uv run pytest tests/ --cov=obsidianrag --cov-report=html
# Lint and format
uv run ruff check obsidianrag/ tests/
uv run ruff format obsidianrag/ tests/
# Build package
uv build
License
MIT
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 obsidianrag-3.0.1.tar.gz.
File metadata
- Download URL: obsidianrag-3.0.1.tar.gz
- Upload date:
- Size: 23.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2217a2d4ac081e797777025462acf09dd595e26be93f6b4faa1abde552a5638
|
|
| MD5 |
5362e15750d47dae88a8631efd66a22d
|
|
| BLAKE2b-256 |
691df73d19a733d72f17cd629a376e081b3eb9301b2f29347aed2b07b9bf97be
|
Provenance
The following attestation bundles were made for obsidianrag-3.0.1.tar.gz:
Publisher:
release-backend.yml on Vasallo94/ObsidianRAG
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
obsidianrag-3.0.1.tar.gz -
Subject digest:
e2217a2d4ac081e797777025462acf09dd595e26be93f6b4faa1abde552a5638 - Sigstore transparency entry: 731727428
- Sigstore integration time:
-
Permalink:
Vasallo94/ObsidianRAG@15c7667e574c16a440a0d3071fc353ef6db8d362 -
Branch / Tag:
refs/tags/v3.0.1 - Owner: https://github.com/Vasallo94
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-backend.yml@15c7667e574c16a440a0d3071fc353ef6db8d362 -
Trigger Event:
push
-
Statement type:
File details
Details for the file obsidianrag-3.0.1-py3-none-any.whl.
File metadata
- Download URL: obsidianrag-3.0.1-py3-none-any.whl
- Upload date:
- Size: 29.0 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 |
396164193d229140663d86815c2d191e1c0f7f5e15d17b57ab913bc1534016ae
|
|
| MD5 |
da9129e5995a375e439adb0e83f2f061
|
|
| BLAKE2b-256 |
9277162c3666050abfc9f0527b081f360f72dd4fefb974f3c5ff581440cfd0f6
|
Provenance
The following attestation bundles were made for obsidianrag-3.0.1-py3-none-any.whl:
Publisher:
release-backend.yml on Vasallo94/ObsidianRAG
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
obsidianrag-3.0.1-py3-none-any.whl -
Subject digest:
396164193d229140663d86815c2d191e1c0f7f5e15d17b57ab913bc1534016ae - Sigstore transparency entry: 731727429
- Sigstore integration time:
-
Permalink:
Vasallo94/ObsidianRAG@15c7667e574c16a440a0d3071fc353ef6db8d362 -
Branch / Tag:
refs/tags/v3.0.1 - Owner: https://github.com/Vasallo94
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-backend.yml@15c7667e574c16a440a0d3071fc353ef6db8d362 -
Trigger Event:
push
-
Statement type: