A-MEM brain-like memory MCP for Claude Code - semantic memory with auto-linking
A-MEM MCP Server
Brain-like memory for Claude Code based on the NeurIPS 2025 paper "A-MEM: Agentic Memory for LLM Agents".
Features
- Automatic memory linking: New memories automatically connect to related existing ones
- Memory evolution: New information updates the context of existing memories
- Rich metadata: Auto-generated keywords, context, and tags
- Global storage: Shared across all projects at
~/.codeagent/memory/ - Fallback mode: Works without A-MEM library using simple keyword matching
Tools
| Tool | Description |
|------|-------------|
| store_memory | Store knowledge with automatic linking and evolution |
| search_memory | Semantic search across all memories |
| read_memory | Read specific memory by ID with full metadata |
| list_memories | List recent memories with filtering |
| update_memory | Update existing memory (triggers re-evolution) |
| delete_memory | Remove a memory |
| get_memory_stats | Statistics about the memory system |
Philosophy
Based on A-MEM (2024) - "Agentic Memory for LLM Agents".
Key insight: Memory should behave like a brain, not a database. New memories automatically link to related ones (Zettelkasten-style), and existing memories evolve when new information arrives.
Installation
Basic (fallback mode - JSON storage)
pip install git+https://github.com/Questi0nM4rk/amem-mcp.git
Full (ChromaDB + semantic search)
pip install "git+https://github.com/Questi0nM4rk/amem-mcp.git[full]"
Note: Full installation requires:
OPENAI_API_KEYenvironment variable for metadata generation- OR Ollama running locally
Usage with Claude Code
claude mcp add amem -- python -m amem_mcp.server
Usage
# Store a memory
store_memory(content="JaCore uses repository pattern with Unit of Work")
# Search memories
search_memory(query="data access patterns")
# Read specific memory
read_memory(memory_id="mem_0001")
How It Works
- Store: Content is analyzed, keywords extracted, and similar memories found
- Link: Bidirectional links created between related memories
- Evolve: Existing memories' context updated with new information
- Search: Vector similarity + link traversal for comprehensive results
Backend
| Feature | Full Mode | Fallback Mode | |---------|-----------|---------------| | Storage | ChromaDB | JSON file | | Search | Semantic vectors | Keyword matching | | Dependencies | chromadb, sentence-transformers | None | | Accuracy | High | Lower |
- Full mode: Uses ChromaDB for vector storage with semantic search
- Fallback mode: JSON file with keyword-based matching (still functional!)
Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| OPENAI_API_KEY | For full mode | LLM for metadata generation |
| CODEAGENT_HOME | Optional | Override default ~/.codeagent |
Storage
Memories stored at: ~/.codeagent/memory/
- ChromaDB (full mode):
~/.codeagent/memory/chromadb/ - JSON (fallback):
~/.codeagent/memory/memories.json