MCP AI Memory

v1.0.0Knowledge & Memorystable

Enables AI agents to store, retrieve, and manage contextual knowledge across sessions using semantic search with PostgreSQL and vector embeddings. Supports memory relationships, clustering, multi-agent isolation, and intelligent caching for persisten

mcp-ai-memorymcpai-integration
Share:
49
Stars
0
Downloads
0
Weekly
0/5

What is MCP AI Memory?

MCP AI Memory is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables ai agents to store, retrieve, and manage contextual knowledge across sessions using semantic search with postgresql and vector embeddings. supports memory relationships, clustering, multi-agen...

Enables AI agents to store, retrieve, and manage contextual knowledge across sessions using semantic search with PostgreSQL and vector embeddings. Supports memory relationships, clustering, multi-agent isolation, and intelligent caching for persisten

This server falls under the Knowledge & Memory category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Enables AI agents to store, retrieve, and manage contextual

Use Cases

Store and retrieve contextual knowledge across AI agent sessions
Enable multi-agent isolation and intelligent semantic search
scanadi

Maintainer

LicenseMIT License
Languagetypescript
Versionv1.0.0
UpdatedMay 20, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-ai-memory

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MCP AI Memory

MCP AI Memory is a TypeScript MCP server that gives AI agents persistent, semantic long-term memory backed by PostgreSQL with the pgvector extension. It stores contextual knowledge as vector embeddings, supports relationship graphs between memories, offers multi-agent isolation so different agents have separate memory namespaces, and includes automatic memory lifecycle management with decay and preservation. Developers building stateful AI agents or workflows that need to remember facts, preferences, or prior interactions across sessions will benefit from this server.

Prerequisites

  • Node.js 18+ or Bun runtime
  • PostgreSQL database with the pgvector extension installed
  • Redis (optional, for caching; an in-memory fallback is available)
  • Claude Desktop or another MCP-compatible client
1

Set up PostgreSQL with pgvector

Install the pgvector extension in your PostgreSQL instance and create a dedicated database for MCP AI Memory.

psql -U postgres -c "CREATE DATABASE mcp_ai_memory;"
psql -U postgres -d mcp_ai_memory -c "CREATE EXTENSION IF NOT EXISTS vector;"
2

Install the package

Install mcp-ai-memory globally via npm so it can be launched with npx.

npm install -g mcp-ai-memory
3

Run database migrations

If installing from source, run migrations to create the required schema. When using the npm package with DATABASE_URL set, migrations run automatically on first launch.

# From source only:
bun run migrate
4

Configure environment variables

Set DATABASE_URL at minimum. REDIS_URL is optional. EMBEDDING_MODEL, MIN_SIMILARITY_SCORE, and MAX_MEMORIES_PER_QUERY can be tuned to change retrieval behavior.

DATABASE_URL=postgresql://user:password@localhost:5432/mcp_ai_memory
REDIS_URL=redis://localhost:6379
EMBEDDING_MODEL=Xenova/all-MiniLM-L6-v2
MIN_SIMILARITY_SCORE=0.5
MAX_MEMORIES_PER_QUERY=10
5

Add the server to Claude Desktop

Register mcp-ai-memory in your claude_desktop_config.json, passing the environment variables so the server can connect to the database.

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "mcp-ai-memory"],
      "env": {
        "DATABASE_URL": "postgresql://user:password@localhost:5432/mcp_ai_memory",
        "REDIS_URL": "redis://localhost:6379"
      }
    }
  }
}

MCP AI Memory Examples

Client configuration

Register MCP AI Memory in Claude Desktop with your PostgreSQL and optional Redis connection strings.

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "mcp-ai-memory"],
      "env": {
        "DATABASE_URL": "postgresql://user:password@localhost:5432/mcp_ai_memory",
        "REDIS_URL": "redis://localhost:6379",
        "MIN_SIMILARITY_SCORE": "0.5",
        "MAX_MEMORIES_PER_QUERY": "10"
      }
    }
  }
}

Prompts to try

Use Claude to store and retrieve information across sessions using the memory tools.

- "Remember that my preferred coding style is tabs, not spaces"
- "Search your memory for anything I told you about my project architecture"
- "What do you remember about my preferences for database design?"
- "List all memories related to my Python projects"
- "Create a relationship between the memory about my project and the one about the database schema"

Troubleshooting MCP AI Memory

Connection error: pgvector extension not found

Install pgvector in your PostgreSQL instance: run CREATE EXTENSION IF NOT EXISTS vector; in the target database as a superuser. Ensure your PostgreSQL version is 12 or newer.

Memories are not returned even though they were stored

Lower the MIN_SIMILARITY_SCORE environment variable (e.g., from 0.5 to 0.3) to retrieve memories with lower semantic similarity. Also check that the embedding model downloaded correctly on first run.

Server fails to start with DATABASE_URL errors

Verify the connection string format: postgresql://user:password@host:port/dbname. Ensure the PostgreSQL server is running and the specified user has CREATE TABLE privileges.

Frequently Asked Questions about MCP AI Memory

What is MCP AI Memory?

MCP AI Memory is a Model Context Protocol (MCP) server that enables ai agents to store, retrieve, and manage contextual knowledge across sessions using semantic search with postgresql and vector embeddings. supports memory relationships, clustering, multi-agent isolation, and intelligent caching for persisten It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MCP AI Memory?

Follow the installation instructions on the MCP AI Memory GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with MCP AI Memory?

MCP AI Memory works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MCP AI Memory free to use?

Yes, MCP AI Memory is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Knowledge & Memory MCP Servers

Explore all knowledge & memory servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

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

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MCP AI Memory?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides