mcp-memory-vec

dlasky/mcp-memory-vec

3.2

If you are the rightful owner of mcp-memory-vec and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Vec Memory MCP Server is a Model Context Protocol server that provides graph-based semantic memory using SQLite vec0 and Ollama embeddings.

Tools
  1. add_memory

    Store content with semantic embedding

  2. get_memory

    Retrieve memory by ID

  3. update_memory

    Update memory content or metadata

  4. delete_memory

    Remove a memory

  5. search_memories

    Semantic search across memories

  6. add_relationship

    Create relationships between memories

  7. get_relationships

    Query relationships with filtering

  8. update_relationship

    Modify relationship strength or metadata

  9. delete_relationship

    Remove a relationship

  10. get_connected_memories

    Find memories connected through relationships

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 ollama
    • Linux: curl -fsSL https://ollama.ai/install.sh | sh
    • Windows: Download from ollama.ai/download

Installation

From npm (recommended)

Add to your MCP client configuration:

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["vec-memory-mcp"]
    }
  }
}

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

npm install
npm run build

Usage

Start the MCP server with stdio transport (default):

npm start
# or
npm run dev

Start with SSE transport for HTTP clients:

npm run build && node dist/index.js --sse
# or custom port
npm run build && node dist/index.js --sse --port 8080

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 embedding
  • get_memory: Retrieve memory by ID
  • update_memory: Update memory content or metadata
  • delete_memory: Remove a memory
  • search_memories: Semantic search across memories

Relationship Operations

  • add_relationship: Create relationships between memories
  • get_relationships: Query relationships with filtering
  • update_relationship: Modify relationship strength or metadata
  • delete_relationship: Remove a relationship
  • get_connected_memories: Find memories connected through relationships

Architecture

  • src/ollama.ts: Ollama management and embedding generation
  • src/database.ts: SQLite database schema and vec0 integration
  • src/memory.ts: Core memory operations and graph traversal
  • src/server.ts: MCP server implementation
  • src/index.ts: Entry point and configuration

Requirements

  • Node.js 18+
  • SQLite with vec0 extension (automatically checked)
  • Ollama (must be installed separately)