Install and configure AutoMem - a long-term memory system for Claude Code that persists across sessions.
AutoMem gives Claude Code persistent memory using:
- FalkorDB (graph database) for relationship tracking
- Qdrant (vector database) for semantic search
- MCP integration for seamless Claude Code access
Before starting, verify these are installed:
# Check Docker is running
docker info > /dev/null 2>&1 && echo "Docker: OK" || echo "Docker: NOT RUNNING"
# Check Node.js version (need 18+)
node --version
# Check Python version (need 3.10+)
python3 --versionIf any prerequisites are missing, install them first.
cd ~
git clone https://github.com/verygoodplugins/automem.git
cd automemGenerate two secure random tokens:
AUTOMEM_TOKEN=$(openssl rand -hex 32)
ADMIN_TOKEN=$(openssl rand -hex 32)
echo "=== SAVE THESE TOKENS ==="
echo "AUTOMEM_API_TOKEN=$AUTOMEM_TOKEN"
echo "ADMIN_API_TOKEN=$ADMIN_TOKEN"
echo "========================="Important: Save the AUTOMEM_API_TOKEN value - you'll need it in Steps 3 and 5.
Create ~/automem/.env:
cat > ~/automem/.env << 'EOF'
FALKORDB_HOST=localhost
FALKORDB_PORT=6379
FALKORDB_GRAPH=memories
QDRANT_URL=http://localhost:6333
QDRANT_COLLECTION=memories
PORT=8001
AUTOMEM_API_TOKEN=PASTE_YOUR_TOKEN_HERE
ADMIN_API_TOKEN=PASTE_YOUR_ADMIN_TOKEN_HERE
EOFThen edit the file to paste your actual tokens:
nano ~/automem/.env
# Or: code ~/automem/.envcd ~/automem
make devWait for services to start (usually 30-60 seconds), then verify:
curl http://127.0.0.1:8001/healthExpected response:
{"status": "healthy", "falkordb": "connected", "qdrant": "connected"}If you get "connection refused", wait a bit longer and retry.
Edit ~/.claude.json to add the MCP server configuration.
If the file doesn't exist or is empty, create it:
cat > ~/.claude.json << 'EOF'
{
"mcpServers": {
"memory": {
"type": "stdio",
"command": "npx",
"args": ["@verygoodplugins/mcp-automem"],
"env": {
"AUTOMEM_ENDPOINT": "http://127.0.0.1:8001",
"AUTOMEM_API_KEY": "PASTE_YOUR_AUTOMEM_API_TOKEN_HERE"
}
}
}
}
EOFIf the file already exists, add the mcpServers block at the top level, being careful to merge with existing content. The key part to add:
{
"mcpServers": {
"memory": {
"type": "stdio",
"command": "npx",
"args": ["@verygoodplugins/mcp-automem"],
"env": {
"AUTOMEM_ENDPOINT": "http://127.0.0.1:8001",
"AUTOMEM_API_KEY": "PASTE_YOUR_AUTOMEM_API_TOKEN_HERE"
}
}
}
}Important: Replace PASTE_YOUR_AUTOMEM_API_TOKEN_HERE with your actual token from Step 2.
Create the global instructions file:
mkdir -p ~/.claude
cat > ~/.claude/CLAUDE.md << 'EOF'
# Claude Code Global Configuration
## Memory System (CLI-based)
To recall memories:
```bash
npx @verygoodplugins/mcp-automem recall --query "<search terms>" --limit 10To store memories:
npx @verygoodplugins/mcp-automem store --content "<memory content>"The CLI connects to the AutoMem service at http://127.0.0.1:8001 EOF
---
## Step 7: Restart Claude Code
**Completely quit Claude Code** (not just close the window):
- macOS: Cmd+Q or right-click dock icon > Quit
- Windows/Linux: Close all windows and ensure process is terminated
Then relaunch Claude Code.
---
## Step 8: Verify Installation
Test the memory system:
```bash
# Store a test memory
npx @verygoodplugins/mcp-automem store --content "AutoMem installation test on $(hostname) at $(date)"
# Recall it
npx @verygoodplugins/mcp-automem recall --query "installation test" --limit 1
If you see your test memory returned, installation is complete!
The Docker services need to be running for AutoMem to work. Before using Claude Code:
cd ~/automem && make devAdd to your shell profile (~/.zshrc or ~/.bashrc):
# Start AutoMem services if not running
if ! curl -s http://127.0.0.1:8001/health > /dev/null 2>&1; then
echo "Starting AutoMem services..."
(cd ~/automem && make dev > /dev/null 2>&1 &)
fi- Docker services aren't running. Run
cd ~/automem && make dev - Wait 30-60 seconds for services to fully start
- Check backend:
curl http://127.0.0.1:8001/health - Verify
~/.claude.jsonhas correct MCP config - Ensure API key matches in both
.envand~/.claude.json - Restart Claude Code completely (Cmd+Q, not just close window)
- API token mismatch between
.envand~/.claude.json - Double-check both files have the same
AUTOMEM_API_TOKENvalue
If ports 6379, 6333, or 8001 are in use:
# Check what's using a port
lsof -i :8001cd ~/automem
make stop
# Or: docker-compose down