Skip to main content
Glama

MCP Vector Memory

Persistent vector memory for AI coding agents. Give your AI agents long-term memory that survives across conversations.

Works with Antigravity · VS Code / Copilot · Claude Code · Codex


The Problem

AI coding agents forget everything between conversations. Every new session starts from zero — they repeat questions, lose architectural decisions, and forget how your project is set up.

The Solution

MCP Vector Memory gives your agents persistent, semantic memory. Agents can save and search memories using natural language. Memories are stored locally in SQLite with vector similarity search — no API keys, no cloud, no cost.

Agent: "I need to set up the database" → search_memory("database setup") → Returns: "PostgreSQL 18 with pgvector, HNSW index, user=app_user..." → Agent works WITH full context from past sessions

Quick Start

1. Install

pip install mcp-vector-memory

2. Configure Your IDE

Add to ~/.gemini/antigravity/mcp_config.json:

{ "mcpServers": { "memory": { "command": "mcp-vector-memory", "args": [], "env": {} } } }

Create .vscode/mcp.json in your workspace:

{ "mcp": { "servers": { "memory": { "command": "mcp-vector-memory", "args": [], "env": {} } } } }

Add to ~/.claude/claude_desktop_config.json:

{ "mcpServers": { "memory": { "command": "mcp-vector-memory", "args": [], "env": {} } } }

Add to your Codex MCP configuration:

{ "mcpServers": { "memory": { "command": "mcp-vector-memory", "args": [], "env": {} } } }

3. Restart your IDE

That's it. Your agents now have persistent memory.

Tools Available

Tool

Description

search_memory

Semantic search over past memories

save_memory

Save a decision, context, or learning

list_projects

List all projects with memory counts

get_stats

Memory system statistics

How It Works

┌─────────────────┐ ┌──────────────────────┐ ┌─────────────┐ │ AI Agent │────▶│ MCP Vector Memory │────▶│ SQLite │ │ (any IDE) │◀────│ (local process) │◀────│ + vectors │ └─────────────────┘ └──────────────────────┘ └─────────────┘ │ Embeddings (all-MiniLM-L6-v2) runs locally
  1. Agent calls save_memory → text is embedded locally → stored in SQLite with vector index

  2. Agent calls search_memory → query is embedded → SQLite finds most similar memories

  3. Everything runs locally. No API calls, no cloud, no cost.

Configuration

All configuration is via environment variables:

Variable

Default

Description

MCP_MEMORY_BACKEND

sqlite

Database backend (sqlite or postgres)

MCP_MEMORY_DATA_DIR

~/.mcp-vector-memory

SQLite data directory

MCP_MEMORY_EMBEDDING_PROVIDER

local

Embedding provider (local or openai)

MCP_MEMORY_EMBEDDING_MODEL

all-MiniLM-L6-v2

Embedding model name

PostgreSQL Backend (Optional)

For production deployments with PostgreSQL + pgvector:

pip install mcp-vector-memory[postgres]
MCP_MEMORY_BACKEND=postgres PGHOST=localhost PGPORT=5432 PGUSER=mcp_memory PGPASSWORD=your_password PGDATABASE=mcp_memory

Docker (PostgreSQL)

docker compose up -d

See docker-compose.yml for the full setup.

OpenAI Embeddings (Optional)

For higher quality embeddings via OpenAI API:

pip install mcp-vector-memory[openai] export OPENAI_API_KEY=sk-... export MCP_MEMORY_EMBEDDING_PROVIDER=openai

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

MIT — see LICENSE

-
security - not tested
A
license - permissive license
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vertexhub-ai/mcp-vector-memory'

If you have feedback or need assistance with the MCP directory API, please join our Discord server