claude-ai-memory
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
claude-ai-memory
An MCP (Model Context Protocol) Server that provides persistent project context storage, management, and semantic search for Claude Code. Powered by OpenViking context database.
The Problem
Claude Code sessions are stateless. When you close the terminal, everything discussed is lost:
Why a certain technical decision was made
What was discussed in the last session and what's still pending
Key information from client communications
Project understanding accumulated across multiple sessions
Project files capture code changes, but not the reasoning, discussions, and context behind them.
Related MCP server: Tempera
The Solution
claude-ai-memory gives Claude Code a persistent memory layer for each project:
Automatic session summaries — Key decisions, changes, and TODOs are saved at the end of each session
Manual memory capture — Use
/rememberto explicitly store important informationSemantic search — Find relevant historical context using natural language queries
Smart context loading — Project overview is loaded at session startup, detailed context is retrieved on-demand
Multi-project isolation — Each project has its own independent context space
Architecture
┌──────────────────────────────────────────────────────┐
│ Docker Compose │
│ │
│ ┌──────────────┐ ┌────────────┐ ┌──────────────┐ │
│ │ openviking │ │ embedding │ │ ollama │ │
│ │ (Rust) │ │ (FastAPI + │ │ Qwen3-0.6B │ │
│ │ :1933 │←─│ MiniLM-L6) │ │ :11434 │ │
│ │ │ │ :8100 │ │ (fallback) │ │
│ └──────┬───────┘ └────────────┘ └──────────────┘ │
│ │ /var/lib/openviking/data (persistent) │
└─────────┼────────────────────────────────────────────┘
↑ HTTP
┌─────────┴────────────────┐
│ claude-ai-memory MCP │
│ (Python, stdio) │
└─────────┬────────────────┘
↑ MCP stdio
┌─────────┴────────┐
│ Claude Code CLI │
│ + CLAUDE.md │
└──────────────────┘Components
Component | Technology | Purpose |
MCP Server | Python + | Exposes 4 tools to Claude Code via stdio transport |
Context Database | OpenViking (Docker) | Filesystem-paradigm context DB with L0/L1/L2 tiered retrieval |
Embedding | all-MiniLM-L6-v2 (local) | Semantic vector encoding, 384 dimensions, zero API cost |
VLM (primary) | Summary generation via Anthropic-compatible API | |
VLM (fallback) | Qwen3-0.6B-FP8 via Ollama | Local CPU inference when API is unavailable |
Cost
Item | Cost |
OpenViking | Free (Apache 2.0) |
Embedding (local) | Free |
Ollama (local) | Free |
MiniMax M2.5 API | ~$1/month ($0.30/M input + $1.20/M output) |
Total | ~$1/month |
MCP Tools
Only 4 coarse-grained tools are exposed to minimize API calls:
context_load
Called once at session startup. Returns project overview, recent session summaries, pending items, and active decisions in a single response.
{
"project_path": "/home/user/my-project"
}context_search
Semantic search across project memory. Returns L1-level content directly — no follow-up calls needed.
{
"project_path": "/home/user/my-project",
"query": "why did we choose Stripe for payments",
"scope": "decisions",
"limit": 5
}context_save
Batch save multiple memory entries in a single call.
{
"project_path": "/home/user/my-project",
"entries": [
{
"type": "session_summary",
"title": "Implemented user registration",
"content": "Completed email registration, verification, password strength check. Used Resend for email. TODO: OAuth login."
},
{
"type": "decision",
"title": "Email service selection",
"content": "Chose Resend over SendGrid: simpler API, sufficient free tier."
}
]
}context_manage
Low-frequency management operations: list, delete, update, and project initialization.
Typical Session Call Pattern
Event | Calls |
Session start | 1x |
During work (30 min session) | 0-3x |
Session end | 1x |
Manual | 1x |
Typical total | 2-5 calls |
Multi-Project Isolation
Each project maps to an independent URI namespace in OpenViking's filesystem paradigm:
viking://
├── projects/
│ ├── <project-hash-1>/ # Project A
│ │ ├── sessions/ # Session summaries
│ │ ├── decisions/ # Architecture decisions
│ │ ├── changes/ # Change records
│ │ └── knowledge/ # Dev resources, notes
│ ├── <project-hash-2>/ # Project B
│ └── ...
└── global/ # Cross-project knowledgeProject ID: first 12 characters of SHA256 hash of the project root absolute path.
Deployment
Prerequisites
Docker & Docker Compose v2
Python 3.10+
MiniMax API key (get one here)
Quick Start
# 1. Clone the repository
git clone https://github.com/alanshaka-real/claude-ai-memory.git
cd claude-ai-memory
# 2. Configure
cp config/ov.conf.example config/ov.conf
# Edit config/ov.conf with your MiniMax API key
# 3. Start services
docker compose up -d
# 4. Pull Ollama fallback model
docker compose exec ollama ollama pull qwen3:0.6b
# 5. Add MCP server to Claude Code
# Add to ~/.claude/settings.json:
# {
# "mcpServers": {
# "claude-ai-memory": {
# "command": "python",
# "args": ["/path/to/claude-ai-memory/mcp-server/server.py"]
# }
# }
# }Upgrading (Zero Data Loss)
docker compose pull openviking # Pull latest image
docker compose up -d openviking # Recreate container, data untouched
docker compose ps # Verify healthy statusData is stored on the host at /var/lib/openviking/data via bind mount — container upgrades never affect your data.
Docker Compose Services
Service | Image | Port | Purpose |
openviking |
| 1933 | Context database |
embedding | Custom (FastAPI + sentence-transformers) | 8100 | Local embedding service |
ollama |
| 11434 | Fallback LLM |
Error Handling
All backend failures are gracefully handled — Claude Code always works normally, with or without memory:
Failure | Behavior |
OpenViking unavailable |
|
Embedding unavailable | Writes succeed, search degrades to directory browsing |
MiniMax API unavailable | Auto-fallback to local Ollama Qwen3-0.6B |
Ollama also unavailable | Raw text saved, summaries queued for retry |
Project not registered | Returns |
How It Works with Claude Code
When a project is initialized, claude-ai-memory injects instructions into the project's CLAUDE.md:
Session start: Claude calls
context_loadto understand project stateDuring work: Claude calls
context_searchwhen historical context is neededSession end: Claude calls
context_saveto preserve session knowledgeManual save: User triggers
/rememberto explicitly store information
This creates a natural memory loop where Claude progressively builds project understanding across sessions.
Project Structure
claude-ai-memory/
├── docker-compose.yml
├── config/
│ └── ov.conf
├── embedding-service/
│ ├── Dockerfile
│ ├── main.py
│ └── requirements.txt
├── mcp-server/
│ ├── __init__.py
│ ├── server.py
│ ├── viking_client.py
│ ├── project_manager.py
│ └── models.py
├── tests/
│ ├── unit/
│ ├── integration/
│ └── e2e/
├── scripts/
│ ├── setup.sh
│ └── inject-claude-md.sh
├── docs/
│ └── plans/
│ └── 2026-03-01-claude-ai-memory-design.md
├── pyproject.toml
└── README.mdLicense
Acknowledgments
OpenViking — Context database for AI Agents
MiniMax — Cost-effective LLM API
sentence-transformers — Local embedding models
Ollama — Local LLM inference
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Persistent context for Claude. Your AI always knows your projects and next actions across sessions.
Shared work memory for Claude Code, Codex, Cursor and chat, scoped to each repository.
Project memory for every AI. Pick up where you left off in Claude, ChatGPT or Cursor, with a team.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides persistent memory for Claude Code, automatically extracting and surfacing relevant context from past sessions to avoid re-explaining issues and decisions.MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude Code with persistent memory that learns from past sessions, capturing coding episodes and surfacing relevant memories to improve over time.6Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables Claude AI coding assistants to persist and restore context across sessions, including saved findings, decisions, progress, checkpoints, file caches, and searchable topic channels. Supports shared memory across parallel sessions and Git-aware context organization.150 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables Claude AI coding assistants to persist and restore context across sessions, preserving decisions, progress, checkpoints, searchable notes, and shared project-channel workflows.150 npmMIT