Home / use case

Offline RAG over 268 Obsidian notes, queryable from a coding agent

At a glance
Models & engines
Embeddings: nomic-embed-text via Ollama (768-dim)
LLM: mistral-nemo:12b via Ollama
Key gotcha
nomic-embed-text needs 'search_document: ' and 'search_query: ' prefixes; it cost him an hour of debugging

What they built

Alex Beattie's vault holds 268 markdown files: internal docs, architecture decisions, API specs and meeting notes. Built-in search only finds exact terms, and he wanted natural-language questions with synthesized, cited answers, completely offline.

He built a local RAG pipeline and wrapped it as MCP tools, so his coding agent checks the vault instead of him switching context.

Setup

  • Embeddings: nomic-embed-text via Ollama (768-dim)
  • Vector DB: ChromaDB, persistent on disk
  • LLM: mistral-nemo:12b via Ollama
  • MCP server: FastMCP (stdio), configured in .cursor/mcp.json
  • Code: github.com/alexbeattie/obsidian-rag

How it works

  1. Chunk on ## / ### headings, dropping chunks under 150 chars and splitting over 2,000 at paragraph boundaries
  2. Embed with task prefixes; IDs are content hashes so re-ingestion upserts
  3. Retrieve and synthesize with mistral-nemo, with citations
  4. Expose search and Q&A as MCP tools

Results & numbers

  • Skipping the nomic prefixes silently drops recall by 15-20%

Gotchas

  • nomic-embed-text needs 'search_document: ' and 'search_query: ' prefixes; it cost him an hour of debugging
“No API keys, no cloud services, no data leaving my machine.”— Alex Beattie

Do it yourself

  1. ollama pull nomic-embed-text && ollama pull mistral-nemo:12b
  2. Split notes on headings with min/max chunk guardrails
  3. Prefix documents with 'search_document: ' and queries with 'search_query: '
  4. Store in ChromaDB with content-hash IDs; re-run ingest safely
  5. Optionally wrap search as an MCP server for your editor's agent
Source: alexbeattie.com · Published 2026-03-20 · Added 2026-10-18. This write-up summarizes the original source; see it for full details.

Similar setups

A local second brain for Markdown notes with Ollama, Whisper and SQLite

WeekendAiProjects built a phone-to-computer note capture system that tidies, links, searches and answers questions over a Markdown vault with local Qwen models, and graded every answer by hand.

DEV Community · 2026-11-08

mdrag: a Rust CLI to chat with an Obsidian vault

A self-contained RAG tool built on SQLite with sqlite-vec and gemma3:1b. It answers 'how did I fix that Git submodule issue?' from your own notes.

orellazri.com · 2026-10-18

Obsidian vault Q&A with Mini-RAG and llama.cpp

An Obsidian plugin that chats with a note or folder, using separate local llama.cpp servers for chat and embeddings (Ollama works too).

Obsidian Community · 2026-10-18

A CPU-only PDF question-answering API with Ollama, Qwen2.5 1.5B and ChromaDB

A developer who wanted to keep documents inside the private network built a small RAG app on a PC with no active GPU: PDFs are indexed into ChromaDB and a local FastAPI endpoint answers questions with Qwen2.5 1.5B on Ollama.

DEV Community (RafterKode) · 2026-12-03