Vault RAG

pending

by Enrique Vasallo

Ask questions about your notes using local AI (Ollama + LangGraph)

β˜… 39 starsUpdated 2mo agoMITDiscovered via Obsidian Unofficial Plugins
View on GitHub

ObsidianRAG 🧠

Ask questions about your Obsidian notes using local AI

Python Tests License Obsidian Plugin

πŸŽ‰ v3 Now Available! - Native Obsidian plugin with local AI. Manual installation or via Community Plugins (pending approval).

A RAG (Retrieval-Augmented Generation) system for querying your Obsidian vault using LangGraph and local LLMs (Ollama). Get intelligent answers based on your personal knowledge base, with full privacy and offline capability.


✨ Key Features

  • πŸ”Œ Native Obsidian Plugin - Install with one click, no terminal required
  • πŸ”’ 100% Local & Private - All AI runs on your machine, zero cloud dependencies
  • πŸ” Advanced RAG - Hybrid search (Vector + BM25) + CrossEncoder reranking
  • πŸ•ΈοΈ GraphRAG - Follows [[wikilinks]] to expand context intelligently
  • 🌍 Multilingual - Works in any language (Spanish, English, etc.)
  • ⚑ Real-time Streaming - See answers generated token-by-token
  • πŸ“Š Source Attribution - Every answer shows relevance scores and links

πŸ“¦ Installation

For End Users (Recommended)

1. Install the Obsidian Plugin

  1. Open Obsidian β†’ Settings β†’ Community Plugins
  2. Browse and search for "Vault RAG"
  3. Click Install β†’ Enable

Note: The plugin is currently pending approval for Community Plugins. For now, install manually by downloading from GitHub Releases.

2. Install Backend

pip install obsidianrag
# or
pipx install obsidianrag

3. Install Ollama

Download Ollama from ollama.ai and pull a model:

ollama pull gemma3

4. Done!

Open the plugin from the ribbon icon (🧠) or command palette: ObsidianRAG: Open Chat


For Developers

Clone and setup for development:

git clone https://github.com/Vasallo94/ObsidianRAG.git
cd ObsidianRAG

# Backend
cd backend
uv sync
uv run pytest

# Plugin
cd ../plugin
pnpm install
pnpm run dev

πŸš€ Quick Start

Using the Plugin

  1. Start the backend server (auto-starts if enabled in settings):

    • Command palette β†’ ObsidianRAG: Start Backend Server
    • Or manually: obsidianrag serve --vault /path/to/vault
  2. Open the chat:

    • Click the 🧠 icon in the ribbon, or
    • Command palette β†’ ObsidianRAG: Open Chat
  3. Ask questions:

    What notes do I have about Python?
    Summarize my meeting notes from this week
    What did I learn about machine learning?
    
  4. Get answers with:

    • βœ… Answer text (with markdown formatting)
    • πŸ“š Source links to your notes
    • 🟒 Relevance scores (green = most relevant)

βš™οΈ Configuration

Plugin Settings

Access via Settings β†’ ObsidianRAG:

SettingDefaultDescription
Server Port8000Backend API port
LLM Modelgemma3Ollama model (gemma3, qwen2.5, llama3.2, etc.)
Auto-start ServertrueStart backend when Obsidian opens
Show Source LinkstrueDisplay note links in answers

Backend Configuration

The backend auto-configures from your vault, but you can customize via CLI:

obsidianrag serve --vault /path/to/vault --port 8000 --model qwen2.5 --reranker

Available CLI options:

  • --vault: Path to your Obsidian vault (required)
  • --port: Server port (default: 8000)
  • --model: Ollama model to use (default: gemma3)
  • --reranker / --no-reranker: Enable/disable reranking (default: enabled)

πŸ—οΈ Architecture

System Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           Obsidian                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚   ObsidianRAG Plugin (TS)      β”‚     β”‚
β”‚  β”‚                                β”‚     β”‚
β”‚  β”‚  β€’ Chat View                   β”‚     β”‚
β”‚  β”‚  β€’ Server Manager              β”‚     β”‚
β”‚  β”‚  β€’ Settings                    β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚ HTTP (localhost:8000)
              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    Backend (Python)                     β”‚
β”‚                                         β”‚
β”‚  FastAPI β†’ LangGraph β†’ Ollama          β”‚
β”‚              ↓                          β”‚
β”‚        ChromaDB + Reranker              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

RAG Pipeline

flowchart LR
    Q[Question] --> R[Retrieve]
    R --> H[Hybrid Search<br/>Vector + BM25]
    H --> RR[Reranker<br/>CrossEncoder]
    RR --> G[GraphRAG<br/>Link Expansion]
    G --> C[Context]
    C --> L[LLM Generate]
    L --> A[Answer]

Retrieve Node:

  1. Hybrid search (60% vector, 40% BM25)
  2. Reranking with BAAI/bge-reranker-v2-m3
  3. GraphRAG expansion (follows [[wikilinks]])
  4. Score filtering (removes low-relevance < 0.3)

Generate Node:

  1. Build prompt with context
  2. Stream tokens from Ollama LLM
  3. Return answer + sources

πŸ€– Supported Models

LLMs (via Ollama)

ModelSizeBest ForInstall
gemma35GBGeneral use, balancedollama pull gemma3
qwen2.54.4GBSpanish, multilingualollama pull qwen2.5
qwen35GBBetter reasoningollama pull qwen3
llama3.22GBSmaller, fasterollama pull llama3.2

Embeddings

  • HuggingFace (default): paraphrase-multilingual-mpnet-base-v2 (auto-downloads)
  • Ollama (optional): nomic-embed-text (ollama pull nomic-embed-text)

πŸ”§ Troubleshooting

See docs/TROUBLESHOOTING.md for detailed solutions.

Quick Fixes

❌ Server shows "Offline"

# Make sure backend is installed
pip install obsidianrag

# Start manually
obsidianrag serve --vault /path/to/vault

❌ "Ollama not running"

# Make sure Ollama is running
ollama serve

# Verify
curl http://localhost:11434/api/tags

❌ Model not found

ollama pull gemma3

πŸ“‚ Project Structure

ObsidianRAG/
β”œβ”€β”€ backend/              # Python backend (PyPI package)
β”‚   β”œβ”€β”€ obsidianrag/      # Main package
β”‚   β”‚   β”œβ”€β”€ api/          # FastAPI server
β”‚   β”‚   β”œβ”€β”€ cli/          # CLI commands
β”‚   β”‚   β”œβ”€β”€ core/         # RAG logic (LangGraph, ChromaDB)
β”‚   β”‚   └── config/       # Settings
β”‚   └── tests/            # 79 tests
β”‚
β”œβ”€β”€ plugin/               # Obsidian plugin (TypeScript)
β”‚   β”œβ”€β”€ src/main.ts       # Plugin entry point
β”‚   β”œβ”€β”€ tests/            # 32 tests
β”‚   └── styles.css        # UI styles
β”‚
└── docs/                 # Documentation

πŸ§ͺ Testing

# Backend tests (79 tests)
cd backend
uv run pytest

# Plugin tests (32 tests)
cd plugin
pnpm test

Coverage:

  • Backend: 42% (focus on core logic)
  • Plugin: Unit tests for HTTP/parsing/settings

🀝 Contributing

We welcome contributions!

  1. Fork the repo
  2. Create a feature branch: git checkout -b feature/awesome-feature
  3. Commit changes: git commit -m 'feat: add awesome feature'
  4. Push: git push origin feature/awesome-feature
  5. Open a Pull Request

See docs/CONTRIBUTING.md for detailed guidelines.


πŸ“„ License

MIT License - see LICENSE


πŸ™ Acknowledgments


Made with ❀️ for the Obsidian community
🌟 Star us on GitHub

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.