Vector Search
Dense embedding-based similarity search using sqlite-vec for efficient nearest-neighbor queries on episodic memory.
How It Works
- Embed: Query text is converted to a 384-dimension vector via BAAI/bge-small-en-v1.5 (loaded through
fastembed) - Search:
sqlite-vecperforms nearest neighbor search onint8quantized vectors stored in thevec_episodestable - Score: Cosine similarity between query and stored vectors
- Rank: Results ordered by similarity (highest first)
Embedding Model
Mnemosyne uses BAAI/bge-small-en-v1.5 exclusively, loaded via the fastembed library:
| Property | Value |
|---|---|
| Model | BAAI/bge-small-en-v1.5 |
| Dimensions | 384 |
| Quantization | int8 (configurable via MNEMOSYNE_VEC_TYPE) |
| Runtime | Local only (no API calls) |
| Library | fastembed |
The model runs entirely locally — no OpenAI API key or network calls are required for embedding generation.
Vector Storage
Vectors are stored in a sqlite-vec virtual table:
-- Internal sqlite-vec table (created automatically)
CREATE VIRTUAL TABLE vec_episodes USING vec0(
embedding int8[384]
);
Usage via recall()
Vector search is performed automatically as part of the recall() method. There is no separate vector_search() API:
from mnemosyne import Memory
mem = Memory()
# recall() internally performs vector + FTS5 hybrid search
results = mem.recall("deployment strategy", top_k=5)
for r in results:
print(f"Score: {r['score']:.3f} — {r['content'][:80]}")
Performance Characteristics
| Dataset Size | Query Time | Index Size |
|---|---|---|
| 1K entries | 15ms | 6MB |
| 10K entries | 35ms | 60MB |
| 100K entries | 85ms | 600MB |
No External Dependencies
Embeddings are generated locally via fastembed. No OpenAI API key, network access, or external embedding service is needed.
Related Pages
Hybrid Search
Learn how Mnemosyne's hybrid search combines dense vector similarity with SQLite FTS5 full-text sear...
Semantic Memory
Discover Mnemosyne's Semantic Memory: the long-term knowledge store for facts, concepts, and relatio...
Configuration
Configure Mnemosyne with environment variables, config files, and runtime options. Covers database p...
Mnemosyne