Obsidian Semantic Search: How a Local Vector Index Works Without a Vector Database
OpenAI
Ollama
OpenRouter
The article explains the implementation of semantic search in the Obsidian plugin Vault Audit AI. The author describes how Markdown notes are converted into vectors, why the system avoids a separate vector database, and how incremental indexing handles changes efficiently.
The author of Vault Audit AI, an Obsidian Community Plugin, added semantic search to address the limitations of full-text search in note-taking. The plugin allows users to search notes by meaning, not just exact word matches. The index is stored inside the Obsidian vault without requiring an external vector database or server. The system works by chunking Markdown notes into pieces, embedding each chunk with a model, and storing the vectors in a custom LocalVectorStore. The chunker respects natural document boundaries like headings and lists, and maintains metadata such as heading path, content hash, and source offsets. Embedding providers include OpenRouter, OpenAI-compatible APIs, and Ollama, all behind a common interface. The LocalVectorStore uses a manifest and a binary file for vectors, with atomic writes ensuring consistency. Incremental indexing compares metadata and content hashes to avoid recomputing embeddings for unchanged chunks. The author highlights the importance of separating components and mentions challenges with asynchronous races that were caught despite passing tests.
- Abbreviations
- API = Application Programming Interface — программный интерфейс приложения
- JSON = JavaScript Object Notation — текстовый формат обмена данными
Source: Habr — хаб ИИ —
original
