
开放记忆
STDIO使Claude记住对话并随时间学习的MCP服务器
使Claude记住对话并随时间学习的MCP服务器
Gives Claude the ability to remember your conversations and learn from them over time.
https://github.com/user-attachments/assets/aef82b8e-3793-4ebd-b993-ddaef14d52d1
You must configure MEMORY_DB_PATH
to a persistent location to avoid losing your conversation history when Claude Desktop closes. If not configured, the database defaults to ./memory.sqlite
in a temporary location that may be cleared when the application restarts.
Node.js: Required to run the MCP server. Verify installation with:
node --version
If not installed, download from nodejs.org
Claude Desktop: Download the latest version for macOS or Windows
The Claude Desktop configuration file is located at:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
To access: Open Claude Desktop → Claude menu → Settings → Developer → Edit Config
Run directly using npm
{ "mcpServers": { "mcp-openmemory": { "command": "npx", "args": [ "@peakmojo/mcp-openmemory@latest" ], "env": { "MEMORY_DB_PATH": "/Users/username/mcp-memory.sqlite" } } } }
Run directly using npm
{ "mcpServers": { "mcp-openmemory": { "command": "npx", "args": [ "@peakmojo/mcp-openmemory@latest" ], "env": { "MEMORY_DB_PATH": "C:\\Users\\username\\mcp-memory.sqlite" } } } }
{ "mcpServers": { "memory": { "command": "npx", "args": ["/path/to/your/repo/server.js"], "env": { "MEMORY_DB_PATH": "/path/to/your/memory.sqlite" } } } }
MEMORY_DB_PATH
: Path to SQLite database file (default: ./memory.sqlite
)After configuring and restarting Claude Desktop, you should see:
save_memory
recall_memory_abstract
update_memory_abstract
get_recent_memories
# Test if the server runs correctly npx @peakmojo/mcp-openmemory@latest
Log Locations:
~/Library/Logs/Claude/
%APPDATA%\Claude\logs\
View recent logs:
# macOS/Linux tail -n 20 -f ~/Library/Logs/Claude/mcp*.log # Windows type "%APPDATA%\Claude\logs\mcp*.log"
APPDATA
to your env configurationnpm install -g npm
For detailed troubleshooting, see the official MCP documentation.
⚠️ Claude Desktop runs MCP servers with your user account permissions. Only install servers from trusted sources.
The server starts automatically when configured with Claude Desktop. The database will be created automatically on first use.
# Memory Usage Guidelines
You should use memory tools thoughtfully to enhance conversation continuity and context retention:
## When to Save Memory
- **save_memory**: Store significant conversation exchanges, important decisions, user preferences, or key context that would be valuable to remember in future conversations
- Focus on information that has lasting relevance rather than temporary details
- Save when users share important personal information, project details, or ongoing work context
## When to Update Memory Abstract
- **update_memory_abstract**: After processing recent conversations, combine new important information with existing context to create an improved summary
- Update when there are meaningful developments in ongoing projects or relationships
- Consolidate related information to maintain coherent context over time
## When to Recall Memory
- **recall_memory_abstract**: Use at the beginning of conversations to understand previous context, or when you need background information to better assist the user
- **get_recent_memories**: Access when you need specific details from recent exchanges that aren't captured in the abstract
- Recall when the user references previous conversations or when context would significantly improve your assistance
## What Constitutes Critical Information
- User preferences and working styles
- Ongoing projects and their current status
- Important personal or professional context
- Decisions made and their rationale
- Key relationships or collaborations mentioned
- Technical specifications or requirements for recurring tasks
Use these tools to build continuity and provide more personalized assistance, not as error-prevention mechanisms or intent-guessing systems.
You can separate memory per project in two ways:
Use different MEMORY_DB_PATH
in each app's config:
claude_desktop_config.json
):"mcpServers": { "claude-memory": { "command": "npx", "args": ["@peakmojo/mcp-openmemory@latest"], "env": { "MEMORY_DB_PATH": "/Users/you/claude-memory.sqlite" } } }
"mcpServers": {
"cursor-memory": {
"command": "npx",
"args": ["@peakmojo/mcp-openmemory@latest"],
"env": {
"MEMORY_DB_PATH": "/Users/you/cursor-memory.sqlite"
}
}
}
Each app runs its own instance, storing to its own DB.
When calling memory tools, pass a custom "context":
{ "context": "project-x", "message": "Notes from project X." }
Use this to segment memory logically within the same database.
🔍 Semantic search is not supported yet. Open a GitHub issue if needed.
MIT License