Vector Memory MCP MCP Server

$uvx vector-memory-mcp --working-dir /path/to/your/project
README.md

Secure vector-based memory server providing persistent semantic memory for AI

Vector Memory MCP Server

A secure, vector-based memory server for Claude Desktop using sqlite-vec and sentence-transformers. This MCP server provides persistent semantic memory capabilities that enhance AI coding assistants by remembering and retrieving relevant coding experiences, solutions, and knowledge.

โœจ Features

  • ๐Ÿ” Semantic Search: Vector-based similarity search using 384-dimensional embeddings
  • ๐Ÿท๏ธ Semantic Normalization: Auto-merge similar tags, normalize categories, structured colon tags
  • ๐Ÿ“Š IDF Tag Weights: Frequency-based weighting for improved search relevance
  • ๐Ÿ’พ Persistent Storage: SQLite database with vector indexing via sqlite-vec
  • ๐Ÿ”’ Security First: Input validation, path sanitization, and resource limits
  • โšก High Performance: Fast embedding generation with sentence-transformers
  • ๐Ÿงน Auto-Cleanup: Intelligent memory management and cleanup tools
  • ๐Ÿ“ˆ Rich Statistics: Comprehensive memory database analytics
  • ๐Ÿ”„ Automatic Deduplication: SHA-256 content hashing prevents storing duplicate memories
  • ๐Ÿง  Smart Cleanup Algorithm: Prioritizes memory retention based on recency, access patterns, and importance

๐Ÿ› ๏ธ Technical Stack

Component Technology Purpose
Vector DB sqlite-vec Vector storage and similarity search
Embeddings sentence-transformers/all-MiniLM-L6-v2 384D text embeddings
Normalization Semantic similarity + guards Tag/category auto-merge
MCP Framework FastMCP High-level tools-only server
Dependencies uv script headers Self-contained deployment
Security Custom validation Path/input sanitization
Testing pytest + coverage Comprehensive test suite

๐Ÿ“ Project Structure

vector-memory-mcp/
โ”œโ”€โ”€ main.py                              # Main MCP server entry point
โ”œโ”€โ”€ README.md                            # This documentation
โ”œโ”€โ”€ requirements.txt                     # Python dependencies
โ”œโ”€โ”€ pyproject.toml                       # Modern Python project config
โ”œโ”€โ”€ .python-version                      # Python version specification
โ”œโ”€โ”€ claude-desktop-config.example.json  # Claude Desktop config example
โ”‚
โ”œโ”€โ”€ src/                                # Core package modules
โ”‚   โ”œโ”€โ”€ __init__.py                    # Package initialization
โ”‚   โ”œโ”€โ”€ models.py                      # Data models & configuration
โ”‚   โ”œโ”€โ”€ security.py                    # Security validation & sanitization
โ”‚   โ”œโ”€โ”€ embeddings.py                  # Sentence-transformers wrapper
โ”‚   โ”œโ”€โ”€ memory_store.py                # SQLite-vec operations
โ”‚   โ”œโ”€โ”€ README_AGENTS.md               # Agent documentation (4 levels)
โ”‚   โ””โ”€โ”€ CASES_AGENTS.md                # Use cases for Brain ecosystem
โ”‚
โ””โ”€โ”€ .gitignore                         # Git exclusions

๐Ÿ—‚๏ธ Organization Guide

This project is organized for clarity and ease of use:

  • main.py - Start here! Main server entry point
  • src/ - Core implementation (security, embeddings, memory store)
  • claude-desktop-config.example.json - Configuration template

New here? Start with main.py and claude-desktop-config.example.json

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.10 or higher (recommended: 3.11)
  • uv package manager
  • Claude Desktop app

Installing uv (if not already installed):

macOS and Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Verify installation:

uv --version

Installation

Option 1: Quick Install via uvx (Recommended)

The easiest way to use this MCP server - no cloning or setup required!

Once published to PyPI, you can use it directly:

# Run without installation (like npx)
uvx vector-memory-mcp --working-dir /path/to/your/project

Claude Desktop Configuration (using uvx):

{
  "mcpServers": {
    "vector-memory": {
      "command": "uvx",
      "args": [
        "vector-memory-mcp",
        "--working-dir",
        "/absolute/path/to/your/project",
        "--memory-limit",
        "100000"
      ]
    }
  }
}

Note: --memory-limit is optional. Omit it to use default 10,000 entries.

Note: Publishing to PyPI is in progress. See PUBLISHING.md for details.

Option 2: Install from Source (For Development)
  1. Clone the project:

    git clone <repository-url>
    cd vector-memory-mcp
    
  2. Install dependencies (automatic with uv): Dependencies are automatically managed via inline metadata in main.py. No manual installation needed.

    To verify dependencies:

    uv pip list
    
  3. Test the server:

    # Test with sample working directory
    uv run main.py --working-dir ./test-memory
    
  4. Configure Claude Desktop:

    Copy the example configuration:

    cp claude-desktop-config.example.json ~/path/to/your/config/
    

    Open Claude Desk

Tools (4)

add_memoryStore a new memory with content, category, and tags for future semantic retrieval.
search_memoryPerform a vector-based similarity search to find relevant past experiences or solutions.
get_statsRetrieve comprehensive memory database analytics and storage statistics.
cleanup_memoryRun the smart cleanup algorithm to manage memory limits based on recency and importance.

Configuration

claude_desktop_config.json
{"mcpServers": {"vector-memory": {"command": "uvx", "args": ["vector-memory-mcp", "--working-dir", "/absolute/path/to/your/project", "--memory-limit", "100000"]}}}

Try it

โ†’Remember that we solved the database connection timeout issue by increasing the pool size to 20 in the production config.
โ†’Search my memory for how we handled OAuth2 authentication in the previous project.
โ†’Show me the statistics for my vector memory database.
โ†’Clean up my memory to free up space, prioritizing keeping the most recent and important coding solutions.

Frequently Asked Questions

What are the key features of Vector Memory MCP?

Vector-based similarity search using 384-dimensional embeddings. Automatic deduplication using SHA-256 content hashing. Semantic normalization to auto-merge similar tags and categories. Smart cleanup algorithm based on recency, access patterns, and importance. Persistent storage using SQLite with vector indexing via sqlite-vec.

What can I use Vector Memory MCP for?

Storing and retrieving complex coding solutions across different chat sessions. Maintaining a persistent knowledge base of project-specific architectural decisions. Organizing coding experiences with automated semantic tag normalization. Managing local AI memory with secure path sanitization and resource limits.

How do I install Vector Memory MCP?

Install Vector Memory MCP by running: uvx vector-memory-mcp --working-dir /path/to/your/project

What MCP clients work with Vector Memory MCP?

Vector Memory MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Use Vector Memory MCP with Conare

Manage MCP servers visually, upload persistent context, and never start from zero with Claude Code & Codex.

Try Free