ai-memory-mcp
Integrates with GitHub Copilot in VS Code to provide persistent memory, allowing storage and retrieval of session summaries and decisions.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ai-memory-mcpLoad my memory for project 'ai-memory-mcp'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π§ AI Memory MCP
Persistent session memory for AI assistants β store, search and retrieve conversation summaries via the Model Context Protocol.
What is this?
AI assistants forget everything between sessions. AI Memory MCP solves that by giving your AI a structured long-term memory:
π Save session summaries with status, tags, modules and file paths
π Search by keyword, full-text (FTS5), or semantic vector similarity
π Restore context at the start of each session with one tool call
π Generate weekly reports from completed tasks automatically
π·οΈ Multi-project / multi-branch support out of the box
Works with Claude Desktop, Cursor, VS Code, Windsurf, and any MCP-compatible client.
Related MCP server: codebase-memory
Quick Start
1 β Install
# From PyPI (recommended)
pip install ai-memory-mcp
# With vector search support (adds ~500 MB for embedding model)
pip install "ai-memory-mcp[vector]"
# From source
git clone https://github.com/zhanpu89/ai-memory-mcp
cd ai-memory-mcp
pip install -e .2 β Configure your AI client
Pick the config snippet for your tool and add it to its MCP settings file:
{
"mcpServers": {
"ai-memory": {
"command": "ai-memory-mcp"
}
}
}{
"mcpServers": {
"ai-memory": {
"command": "ai-memory-mcp"
}
}
}{
"servers": {
"ai-memory": {
"type": "stdio",
"command": "ai-memory-mcp"
}
}
}{
"mcpServers": {
"ai-memory": {
"command": "ai-memory-mcp"
}
}
}Start the server:
ai-memory-mcp --http
# or: python service.py startThen point your client at:
{
"mcpServers": {
"ai-memory": {
"url": "http://localhost:8000/mcp"
}
}
}All config snippets are available in
integrations/.
3 β Use it
At the start of every session, tell your AI:
Load my memory for project "my-project"The AI will call init_session and restore your previous context automatically.
Features
Feature | Details |
Storage | SQLite β zero external services, single file |
Full-text search | SQLite FTS5 β fast, no extra deps |
Semantic search | ChromaDB + |
Multi-project | Filter by |
Task lifecycle |
|
Key decisions | Attach architectural decisions to sessions |
Weekly reports | Auto-generated Markdown report |
Transport | stdio (local) or streamable-HTTP (remote) |
Docker | Single-container deployment included |
Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β AI Client (Claude / Cursor β¦) β
β MCP Protocol β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β stdio / HTTP
ββββββββββββββββββββββββΌβββββββββββββββββββββββββββ
β AiMemoryMcpServer (FastMCP) β
β β
β ββββββββββββββββ ββββββββββββββββββββββββ β
β β SQLite DB β β ChromaDB (optional) β β
β β FTS5 index β β Sentence-Transformersβ β
β ββββββββββββββββ ββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββData lives in ~/.ai-memory/ β completely separate from your project files.
Tool Reference
β See TOOLS.md for the full schema of all 10 tools.
Tool | Description |
| Persist a new session summary |
| Update status / content |
| Record a key technical decision |
| Keyword / FTS5 / vector search |
| Dedicated FTS5 full-text search |
| Exact lookup by session ID |
| List latest sessions |
| Restore context at session start |
| Generate Markdown weekly report |
| Rebuild index, VACUUM, persist vectors |
Configuration
All settings are optional β sensible defaults work out of the box.
Env var | Default | Description |
|
| SQLite database path |
|
| Embedding model cache |
|
| HTTP server bind address |
|
| HTTP server port |
Create ~/.ai-memory/.env to persist settings:
AI_MEMORY_DB_PATH=/custom/path/ai_memory.db
AI_MEMORY_PORT=9000Docker
Optimized for China: Uses Tsinghua pip mirror + HuggingFace mirror for fast downloads.
# Option 1: Core-only (lightweight, ~200 MB image)
docker compose up -d
# Option 2: Full (with vector search)
# Step 1: Pre-download model to avoid large image
python3 scripts/download_model_for_docker.py --output ./models
# Step 2: Build with vector support (~700 MB image + 500 MB external model)
docker compose build --build-arg INSTALL_VECTOR=true
docker compose up -d
# View logs
docker compose logs -fThe MCP endpoint will be available at http://localhost:8000/mcp.
π Full deployment guide: See DOCKER.md for:
Image size optimization strategies
Chinese mirror configuration
Model pre-downloading
Production deployment examples
Development
# Clone and install in editable mode with dev extras
git clone https://github.com/zhanpu89/ai-memory-mcp
cd ai-memory-mcp
pip install -e ".[dev]"
# Run tests
pytest
# Run tests with coverage
pytest --cov=src/mcp_server --cov-report=term-missing
# Start in HTTP mode for manual testing
ai-memory-mcp --httpProject Structure
ai-memory-mcp/
βββ src/mcp_server/
β βββ __init__.py
β βββ server.py # All 10 MCP tools + server class
βββ tests/
β βββ unit/ # 24 unit tests
β βββ integration/
βββ scripts/
β βββ download_model.py # Manual model download
β βββ migrate_db.py # Database migration helper
β βββ migrate_vector.py # Vector store migration
βββ integrations/ # Ready-to-use MCP client configs
β βββ claude_desktop_config.json
β βββ cursor_mcp.json
β βββ vscode_mcp.json
β βββ windsurf_mcp.json
β βββ http_mode_config.json
βββ TOOLS.md # Full tool schema reference
βββ INSTALL.md # Detailed installation guide
βββ Dockerfile
βββ docker-compose.yml
βββ pyproject.tomlTesting
24 passed in 7spytest tests/unit/test_mcp_server.py -vAll 24 unit tests cover: save/update/search/FTS/vector/decisions/maintenance/init/review/schema.
Requirements
Python 3.10+
mcp >= 1.6.0python-dotenv >= 1.0.0
Optional (vector search):
chromadb >= 0.6.0sentence-transformers >= 3.0.0
License
MIT Β© AI Memory Team
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/zhanpu89/ai-memory-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server