Embeddings
Optionally augment FTS search with vector similarity. When configured, mor find merges FTS and vector results using Reciprocal Rank Fusion (RRF) — combining rankings without manual weight tuning.
Configuration
Section titled “Configuration”Add to ~/.config/mor/config.json:
{ "embedding": { "provider": "openai", "model": "text-embedding-3-small", "dimensions": 1536 }}Then rebuild the index:
mor reindexEmbeddings are computed automatically on add and update. Only reindex is needed for the initial build or after changing providers.
Providers
Section titled “Providers”OpenAI
Section titled “OpenAI”{ "embedding": { "provider": "openai", "model": "text-embedding-3-small", "dimensions": 1536 }}Set OPENAI_API_KEY in your environment. Default base URL is https://api.openai.com/v1.
Azure OpenAI
Section titled “Azure OpenAI”{ "embedding": { "provider": "azure-openai", "model": "text-embedding-3-small", "baseUrl": "https://your-resource.openai.azure.com" }}Set AZURE_OPENAI_API_KEY in your environment (falls back to OPENAI_API_KEY).
The deployment name defaults to the model name. Set "deployment": "my-deploy" to override. apiVersion defaults to 2024-10-21.
Ollama
Section titled “Ollama”{ "embedding": { "provider": "ollama", "model": "nomic-embed-text", "dimensions": 768 }}Default base URL is http://localhost:11434. No API key needed.
How it works
Section titled “How it works”- On
add/update, the memory’s title + tags + content are concatenated and sent to the embedding provider - The resulting vector is stored in the
embeddingstable and indexed via sqlite-vec for fast KNN search - On
find, the query is embedded and compared against stored vectors using cosine distance - FTS and vector rankings are combined using Reciprocal Rank Fusion (RRF)
- Frequently accessed memories get a small ranking boost (~5% max)
When to use embeddings
Section titled “When to use embeddings”Embeddings help when:
- You search for concepts rather than exact words (“error handling” finds
retryWithBackoff.ts) - FTS tokenization misses your query (searching “correct” finds
AwaitTaskCorrect)
Embeddings may not help when:
- Your memory store is small (FTS + grep cover most cases)
- You search for exact strings (use
grepinstead) - Score distributions are flat (all results score similarly)
For most personal use, FTS + grep is sufficient. Embeddings are worth trying if you have hundreds of memories and find yourself refining searches often.