A command-line tool for graph-based semantic memory using SQLite vec0 and Ollama embeddings. All output is JSON for easy parsing and tool integration.
- Semantic Search: Vector-based similarity search using embeddings
- Graph Relationships: Create and traverse relationships between memories
- JSON Output: All commands output JSON for easy scripting and integration
- Flexible Storage: SQLite with vec0 extension for efficient vector operations
- Node.js 18+
- Ollama: Install from ollama.ai or:
- macOS:
brew install ollama - Linux:
curl -fsSL https://ollama.ai/install.sh | sh - Windows: Download from ollama.ai/download
- macOS:
npm install -g @dlasky/vec-memory-clinpm install
npm run buildThe CLI will automatically start Ollama if it's not running and download the required embedding model if needed.
# Store a memory
vec-memory add "The sky is blue"
vec-memory add "Deploy failed" -m '{"severity":"high"}'
# Retrieve a memory by ID
vec-memory get <id>
# Update a memory
vec-memory update <id> --content "New content"
vec-memory update <id> --metadata '{"key":"value"}'
# Delete a memory
vec-memory delete <id>
# Semantic search
vec-memory search "what color is the sky"
vec-memory search "deploy" -n 5 -t 0.3# Create a relationship between two memories
vec-memory relate <from-id> <to-id> causes
vec-memory relate <from-id> <to-id> related_to -s 0.8
# List relationships
vec-memory relations
vec-memory relations --memory-id <id> --type causes
# Update a relationship
vec-memory update-relation <id> --strength 0.5
# Delete a relationship
vec-memory delete-relation <id>
# Traverse the graph (BFS)
vec-memory connected <id> -d 3| Option | Default | Description |
|---|---|---|
--db |
~/.vec-memory.db |
Path to SQLite database |
--ollama-url |
http://localhost:11434 |
Ollama API base URL |
--model |
nomic-embed-text |
Ollama embedding model |
These can also be set via environment variables:
MEMORY_DB_PATH— Database pathOLLAMA_BASE_URL— Ollama URLOLLAMA_MODEL— Embedding model
src/index.ts— CLI entry point and command definitionssrc/ollama.ts— Ollama management and embedding generationsrc/database.ts— SQLite database schema and vec0 integrationsrc/memory.ts— Core memory operations and graph traversal