Mnemonic integrates with @tobilu/qmd for semantic vector search over your memories. This enables natural language queries and conceptual similarity matching beyond simple keyword search.
QMD provides three search methods:
- BM25 Search (
qmd search): Keyword-based ranking algorithm - Vector Search (
qmd vsearch): Semantic similarity using embeddings - Hybrid Search (
qmd query): Combines both for best results
- Node.js >= 22
- npm (comes with Node.js)
# Install qmd globally
npm i -g @tobilu/qmd
# Run automated setup
/mnemonic:qmd-setupThe setup skill will:
- Verify prerequisites
- Discover memory roots from
~/.config/mnemonic/config.json - Register collections for each memory root:
${MNEMONIC_ROOT}/{org}/→mnemonic-{org}${MNEMONIC_ROOT}/default/→mnemonic-default.claude/mnemonic/→mnemonic-project(if exists)
- Build search index (
qmd update) - Generate embeddings (
qmd embed) - Validate with test search
Note: First qmd embed downloads ~2 GB of GGUF models.
If you prefer manual configuration:
# Resolve MNEMONIC_ROOT from config
MNEMONIC_ROOT=$(python3 -c "import json; print(json.load(open('$HOME/.config/mnemonic/config.json')).get('memory_store_path', '$HOME/.local/share/mnemonic'))" 2>/dev/null || echo "$HOME/.local/share/mnemonic")
# Register collections
qmd collection add "${MNEMONIC_ROOT}/zircote/" --name mnemonic-zircote
qmd collection add "${MNEMONIC_ROOT}/default/" --name mnemonic-default
qmd collection add ".claude/mnemonic/" --name mnemonic-project # if in a repo
# Build index and embeddings
qmd update
qmd embed
# Verify
qmd status# BM25 keyword search
qmd search "authentication middleware"
# Semantic vector search
qmd vsearch "how do we handle user sessions"
# Hybrid search (recommended)
qmd query "database migration strategy"Search within specific memory collections:
# Organization-level memories only
qmd search "api design" -c mnemonic-zircote
# Project-level memories only
qmd search "api design" -c mnemonic-project
# All collections (default)
qmd search "api design"# Top 5 results
qmd search "authentication" -n 5
# Top 10 results (default)
qmd search "authentication"
# Custom limit
qmd query "error handling" -n 3# Multi-term queries
qmd query "user authentication AND session management"
# Natural language
qmd vsearch "What are our conventions for REST API error codes?"
# Technical concepts
qmd query "dependency injection patterns in Python"QMD indexes are not automatically updated. Re-index after:
- Capturing new memories
- Bulk imports
- Direct file edits
- Hook-based captures
/mnemonic:qmd-reindex# Full re-index
qmd update && qmd embed
# Index only (skip embeddings for speed)
qmd update
# Specific collection only
qmd update -c mnemonic-project && qmd embed -c mnemonic-projectqmd collection listqmd collection add /path/to/memories --name my-collectionqmd collection remove my-collection# Overview of all collections
qmd status
# Detailed info
qmd collection info mnemonic-zircote# Question: "What decisions have we made about authentication?"
qmd query "authentication decisions" -n 10
# Review results, then drill down with ripgrep
rg "authentication" ${MNEMONIC_ROOT} --glob "*decisions*.memory.md"# Question: "What patterns do we use for error handling?"
qmd vsearch "error handling patterns"
# Get specific files
qmd search "error" -c mnemonic-project | grep "\.memory\.md" | xargs cat# Question: "Everything related to PostgreSQL"
qmd query "postgresql" | grep "\.memory\.md" | while read file; do
echo "=== $file ==="
cat "$file"
done| Memory Count | Index Time | Embedding Time | Disk Space |
|---|---|---|---|
| 100 | ~5s | ~30s | ~5 MB |
| 1,000 | ~30s | ~5 min | ~50 MB |
| 10,000 | ~5 min | ~45 min | ~500 MB |
QMD rebuilds the entire index on update. For large collections:
# Index only changed files (manual approach)
find ${MNEMONIC_ROOT} -name "*.memory.md" -mtime -1 | xargs qmd update --filesEmbeddings are cached. Deleting files from memory roots doesn't remove their embeddings until re-index:
# Force full rebuild
rm -rf ~/.qmd/cache
qmd update && qmd embed/mnemonic:capture decisions "Use PostgreSQL for main database"
/mnemonic:qmd-reindex# Semantic search for relevant memories
qmd query "database schema patterns"
# Recall specific memory by ID (from search results)
/mnemonic:recall --id 550e8400-e29b-41d4-a716-446655440000The /mnemonic:search skill includes enhanced iterative search with synthesis, which can use qmd for initial search:
/mnemonic:search "comprehensive guide to our authentication system"# Install globally
npm i -g @tobilu/qmd
# Or use npx
npx @tobilu/qmd search "test"# Check collections are registered
qmd collection list
# Check index exists
qmd status
# Re-index
qmd update && qmd embed# Check qmd embed completed successfully
qmd embed
# First run downloads models (~2 GB)
# Ensure sufficient disk space and network connection# Re-index to include new memories
qmd update && qmd embed# Use keyword search instead of vector search
qmd search "term" instead of qmd vsearch "term"
# Limit results
qmd query "term" -n 5
# Search specific collections
qmd search "term" -c mnemonic-project| Command | Purpose | Requires Index | Requires Embeddings |
|---|---|---|---|
qmd collection add <path> |
Register directory | No | No |
qmd collection list |
Show collections | No | No |
qmd collection remove <name> |
Unregister collection | No | No |
qmd update |
Build BM25 index | No | No |
qmd embed |
Generate embeddings | Yes (update) | No |
qmd search <query> |
BM25 keyword search | Yes (update) | No |
qmd vsearch <query> |
Vector semantic search | Yes (update) | Yes (embed) |
qmd query <query> |
Hybrid search | Yes (update) | Yes (embed) |
qmd status |
Show index status | No | No |