Vector Search
approvedby Ashwin A Murali
Semantic search for your notes using Ollama and nomic-embed-text embeddings. Requires Ollama installation.
Obsidian Vector Search Plugin
This plugin adds semantic search capabilities to Obsidian using Ollama's embedding API. It allows you to find semantically similar notes based on content rather than just keyword matching.
Features
- 🔍 Semantic search across your entire vault
- 🤖 Powered by Ollama's embedding model
- 📊 Configurable similarity threshold
- 🚀 Fast local search once embeddings are generated
- ⚡ Automatic file change detection and updates
- 📝 Smart text chunking strategies
- 🔄 Efficient incremental updates
Prerequisites
1. Ollama Setup
- Install Ollama for your platform:
- Verify installation by running
ollama --versionin terminal - Start Ollama service:
- It should run automatically on macOS
- On Linux:
systemctl start ollamaor runollama serve - On Windows: Run Ollama from Start Menu
2. Model Installation
- Pull the required embedding model:
ollama pull nomic-embed-text
- Verify model installation:
ollama list
- Expected size: ~500MB
- First-time embedding generation might be slower
3. System Requirements
- Minimum 1GB RAM for Ollama service
- ~500MB disk space for the model
- Stable internet connection for initial model download
- Port 11434 must be available (default Ollama port)
4. Troubleshooting
-
If Ollama service isn't responding:
curl http://localhost:11434/api/embeddingsShould return a response (even if error)
-
Common issues:
- Port 11434 in use: Change port in Ollama config
- Permission denied: Run with sudo on Linux
- Model download fails: Check internet connection
- High CPU usage: Normal during first few runs
Installation
- Clone this repo to your
.obsidian/plugins/folder - Install dependencies:
npm install - Build the plugin:
npm run dev - Enable the plugin in Obsidian's settings
Usage
-
Initial Setup
- Go to Settings > Vector Search
- Configure your Ollama URL (default: http://localhost:11434)
- Set your desired similarity threshold (0-1)
-
Building the Index
- Click the vector search icon in the ribbon
- Wait for all notes to be processed (progress will be shown)
-
Searching
- Select any text in a note
- Use the command "Find Similar Notes" (or set up a hotkey)
- View results in the popup modal
How it Works
- The plugin creates vector embeddings for all your markdown notes using Ollama
- When you search, it:
- Creates an embedding for your selected text
- Uses cosine similarity to find the most similar notes
- Shows results above your configured threshold
Development
npm run dev- Start compilation in watch modenpm run build- Build the pluginnpm test- Run tests
Logs
The plugin logs all API calls and operations to the Developer Console (Ctrl+Shift+I or Cmd+Option+I on Mac). This includes:
- Embedding API requests
- Index building progress
- File processing status
- Any errors or issues
Configuration
{
"ollamaURL": "http://localhost:11434",
"searchThreshold": 0.7,
"chunkSize": 500,
"chunkOverlap": 100,
"chunkingStrategy": "paragraph",
"fileProcessingDebounceTime": 2000
}
Chunking Strategies
- Paragraph: Splits text by paragraphs (default)
- Character: Splits text by character count with overlap
File Processing
- Automatically detects file changes
- Updates vectors when files are modified
- Handles file renames and deletions
- Debounced processing to prevent overload
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.