Provides semantic memory capabilities using Ollama's embedding models to generate vector embeddings for semantic search and similarity operations across stored memories.
Uses SQLite with the vec0 extension as the storage backend for managing semantic memories, vector embeddings, and graph-based relationships between memories.
Vec Memory MCP Server
An MCP (Model Context Protocol) server that provides graph-based semantic memory using SQLite vec0 and Ollama embeddings.
Features
Semantic Search: Vector-based similarity search using embeddings
Graph Relationships: Create and traverse relationships between memories
Flexible Transport: Support for both stdio and SSE (HTTP) transports
Flexible Storage: SQLite with vec0 extension for efficient vector operations
MCP Integration: Standard MCP server for easy integration
Prerequisites
Node.js 18+
Ollama: Install from ollama.ai or:
macOS:
brew install ollamaLinux:
curl -fsSL https://ollama.ai/install.sh | shWindows: Download from ollama.ai/download
Installation
From npm (recommended)
Add to your MCP client configuration:
The server will be automatically downloaded and started when needed.
Note: The server will automatically start Ollama if it's not already running and download the required embedding model if needed.
From source
Usage
Start the MCP server with stdio transport (default):
Start with SSE transport for HTTP clients:
Run npm run build && node dist/index.js --help for all options.
Environment Variables
MEMORY_DB_PATH: Path to SQLite database (default:./memory.db)OLLAMA_BASE_URL: Ollama API URL (default:http://localhost:11434)OLLAMA_MODEL: Embedding model to use (default:nomic-embed-text)
MCP Tools
Memory Operations
add_memory: Store content with semantic embeddingget_memory: Retrieve memory by IDupdate_memory: Update memory content or metadatadelete_memory: Remove a memorysearch_memories: Semantic search across memories
Relationship Operations
add_relationship: Create relationships between memoriesget_relationships: Query relationships with filteringupdate_relationship: Modify relationship strength or metadatadelete_relationship: Remove a relationshipget_connected_memories: Find memories connected through relationships
Architecture
src/ollama.ts: Ollama management and embedding generationsrc/database.ts: SQLite database schema and vec0 integrationsrc/memory.ts: Core memory operations and graph traversalsrc/server.ts: MCP server implementationsrc/index.ts: Entry point and configuration
Requirements
Node.js 18+
SQLite with vec0 extension (automatically checked)
Ollama (must be installed separately)