Deep knowledge retrieval for Obsidian, completely offline.
Like sonar detecting hidden objects beneath the surface, Sonar discovers meaningful connections across your notes through semantic search and AI-powered chat. Index markdown, PDF, and audio files, then explore your knowledge base via direct search or interactive conversations — all running locally on your device with llama.cpp.
Core features run entirely on your device — no cloud services, no data leaving your machine.
Sonar runs entirely on your local machine — all embedding, reranking, and LLM inference happens locally. This requires machine resources depending on your model configuration. For the default models, the following specifications are recommended:
# macOS (Homebrew)
brew install llama.cpp
# Windows (winget)
winget install llama.cpp
On Linux, download prebuilt binaries from the releases page or build from source:
# Linux (build from source)
sudo apt install git cmake build-essential libcurl4-openssl-dev
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
cmake -B build
cmake --build build --config Release
# Binaries are in ./build/bin/
You can install Sonar either via
Enter https://github.com/aviatesk/obsidian-sonar and click Add Plugin
Manual installation (requires Node.js 18+):
bash
git clone https://github.com/aviatesk/obsidian-sonar.git
cd obsidian-sonar
npm install
npm run build
cp main.js manifest.json styles.css /path/to/your/vault/.obsidian/plugins/obsidian-sonar/
llama-server if installed via Homebrew or winget (resolved
automatically)which llama-server (macOS/Linux) or where llama-server (Windows)
to find the absolute pathSonar automatically indexes your vault in the background. When you create or edit notes, they are re-indexed to keep search results up to date.
Sonar shows the indexing status in the status bar as follows
![]()
![]()
Files are split into chunks and converted to vector embeddings, which are stored locally in an IndexedDB database along with a BM25 index for hybrid search.
Supported file types:
.md): Full text with metadata extraction.pdf): Text extraction from PDF documents.m4a, .mp3, .wav, etc.): Transcription via whisper.cpp
(requires additional setup)Commands:
Sonar: Index current file — Index only the active fileSonar: Sync search index with vault — Add new files and remove deleted onesSonar: Rebuild current search index — Full reindex of all filesSonar: Clear current search index — Clear the current indexSonar: Delete all search databases for this vault — Delete all databasesSonar: Show files that failed to index — Show files that failed to indexSonar: Show indexable files statistics — Show statistics of indexable filesContext menu (creates a new note with extracted content):
Configuration (in Settings → Sonar):
ggml-org/bge-m3-Q8_0-GGUF.
Models are cached in ~/Library/Caches/llama.cpp/ (macOS),
~/.cache/llama.cpp/ (Linux), or %LOCALAPPDATA%\llama.cpp (Windows). If a
model is not cached, a confirmation dialog will ask you to permit the
download.notes/). Leave
empty to index the entire vault.templates/, daily/). Paths are matched as prefixes.Sonar: Sync search index with vault or Sonar: Index current file to update
the index.To index audio files, install whisper.cpp, ffmpeg, and huggingface-cli. Then download a Whisper model from https://huggingface.co/ggerganov/whisper.cpp.
Configure in Settings → Sonar:
whisper-cli (or absolute path)~/whisper-models/ggml-large-v3-turbo-q5_0.bin)ffmpeg (or absolute path)macOS setup example
brew install whisper-cpp ffmpeg
pip install huggingface-hub
mkdir -p ~/whisper-models
huggingface-cli download ggerganov/whisper.cpp \
ggml-large-v3-turbo-q5_0.bin \
--local-dir ~/whisper-models/
Find notes by meaning using natural language queries. Unlike keyword search, semantic search understands concepts and returns relevant results even when exact words don't match.
Searching for input query with reranking enabled
Getting started:
Sonar: Open Semantic note finder from the command paletteSonar uses hybrid search (vector + BM25) with optional cross-encoder reranking for best results. Toggle reranking via the sparkles icon in the search bar.
Configuration (in Settings → Sonar):
gpustack/bge-reranker-v2-m3-GGUFDiscover notes related to what you're currently reading. The panel updates automatically as you edit, scroll, or switch notes — showing results relevant to your current context.
Auto-following mode: Related notes based on current cursor position
Edit mode: Manually editing query with knowledge graph visualization
Getting started:
Sonar: Open related notes view from the command paletteOptions (toggle via toolbar icons or in Settings → Sonar):
Query editing: When the query is visible, click the pencil icon to enter edit mode. This freezes auto-updates and lets you search with a custom query. Click again to resume automatic context tracking.
Chat with an AI assistant that has access to your knowledge base. The assistant can search your vault, read files, edit notes, and search the web.
Vault integration: Search your knowledge base and get grounded answers
Extension tools: Agent performs web search via SearXNG
Getting started:
Sonar: Open chat view from the command paletteVoice input: Click the microphone button to speak your query. Requires whisper.cpp (setup).
Configuration (in Settings → Sonar):
bartowski/Qwen3-8B-GGUFTools allow the assistant to take actions beyond generating text — such as searching your vault, reading files, or making web requests. The assistant decides when to use tools based on your request.
[!WARNING] Some models don't support tool calling. Sonar automatically detects this via llama.cpp's
/propsendpoint and disables tools when unsupported. To manually check, runcurl http://localhost:<port>/props | jq '.chat_template_caps'and look for"supports_tool_calls": true. Models like Gemma typically lack tool support, while Qwen and Llama models generally support it.
Built-in tools:
| Tool | Description |
|---|---|
search_vault |
Search your knowledge base semantically |
read_file |
Read content from markdown, PDF, or audio |
edit_note |
Create or modify notes in your vault |
fetch_url |
Fetch and extract text from a web page (disabled by default) |
Extension tools: Extend the assistant with custom tools. Several example tools are provided, including web search via SearXNG and calendar integrations. See extension-tools/README.md for the API and setup instructions.
You can provide custom context about your vault to help the assistant understand your vault structure and preferences. Create a markdown file anywhere in your vault and specify its path in Settings → Sonar → Chat configuration → Vault context file.
Example vault context file:
## About this vault
This vault contains my research notes on machine learning and software
engineering.
## Folder structure
- `research/`: Academic papers and reading notes
- `projects/`: Active project documentation
- `journal/`: Daily notes and reflections
## Preferences
- I prefer concise, technical responses
- When searching for ML topics, prioritize the `research/` folder
The content is included in the system prompt, so the assistant can use this information when searching your vault or answering questions.
See AGENTS.md for detailed development guidelines.
gpt-4.1-mini (42%) on a 60K-page corpus, with lower
hallucination rate (32% vs 35%)This project is licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). See LICENSE for details.
This project was selected for IPA MITOU Advanced 2025 and developed with their support.
[^RAM-recommendation]: The default models (BGE-M3 for embeddings, Qwen3-8B for chat) require substantial memory. You can configure smaller models in settings to run on machines with less RAM.
[^GPU-recommendation]: GPU acceleration significantly improves performance for both indexing (embedding generation) and agentic chat (LLM inference). With
$ claude mcp add obsidian-sonar \
-- python -m otcore.mcp_server <graph>