# Clone the repository
git clone https://github.com/proofgeist/obsidian-notes-rag.git
cd obsidian-notes-rag
# Install with dev dependencies
uv sync --dev
# Pull the embedding model
ollama pull nomic-embed-textsrc/obsidian_rag/
├── __init__.py # Package version
├── cli.py # Click CLI commands
├── server.py # MCP server (FastMCP)
├── indexer.py # Markdown parsing, chunking, Ollama embeddings
├── store.py # ChromaDB vector store wrapper
└── watcher.py # File watcher daemon (watchdog)
- VaultIndexer scans markdown files, excludes patterns (
.obsidian/, etc.) - parse_frontmatter() extracts YAML frontmatter
- chunk_by_heading() splits content by
##and###headings - OllamaEmbedder generates embeddings via local Ollama API
- VectorStore persists chunks + embeddings to ChromaDB
The server exposes 5 tools via FastMCP:
search_notes- Semantic searchget_similar- Find similar notesget_note_context- Note + related contextget_stats- Index statisticsreindex- Re-index vault
Uses watchdog to monitor the vault directory:
- Debounces rapid file changes (default 2s)
- Handles create/modify/delete/move events
- Can run as macOS launchd service
uv run pytest -vuv run pyright- Python 3.11+
- Type hints required
- Docstrings for public functions
- Create a feature branch
- Make changes with tests
- Ensure
pytestandpyrightpass - Submit PR with conventional commit message
Use Conventional Commits:
feat: add new search filter
fix: handle empty vault gracefully
docs: update installation instructions
refactor: simplify chunking logic
Releases are automated via release-please. When PRs with conventional commits are merged to main, release-please creates a release PR that bumps the version and updates the changelog.
For development, you can set these in your shell or a .env file:
| Variable | Default | Description |
|---|---|---|
OBSIDIAN_RAG_VAULT |
(hardcoded) | Path to Obsidian vault |
OBSIDIAN_RAG_DATA |
(hardcoded) | Path to ChromaDB data |
OBSIDIAN_RAG_OLLAMA_URL |
http://localhost:11434 |
Ollama API URL |
OBSIDIAN_RAG_MODEL |
nomic-embed-text |
Embedding model |
OBSIDIAN_RAG_DEBOUNCE |
2.0 |
Watcher debounce seconds |
| Package | Purpose |
|---|---|
| chromadb | Vector store |
| watchdog | File system monitoring |
| mcp | MCP server framework |
| httpx | HTTP client for Ollama |
| click | CLI framework |
| pyyaml | Frontmatter parsing |