使用说明
mcp-memory-server
MCP server with cognitive-science-based memory decay and consolidation for AI agents.
Features
- ACT-R + FadeMem decay: Memories weaken over time based on cognitive science models
- Dual-layer storage: Short-term (STM) and long-term (LTM) with automatic promotion/demotion
- Consolidation: Merge similar memories, archive weak ones, promote strong ones
- MCP compatible: Works with any MCP client (Claude Code, OpenClaw, etc.)
Install
pip install -e ".[dev]"
Usage
# As MCP server
python -m mcp_memory_server
# Register with Claude Code
claude mcp add --transport stdio memory-server -- python -m mcp_memory_server
Tools
| Tool | Purpose |
|---|---|
store_memory |
Store new memory in short-term layer |
search_memory |
Search ranked by activation score |
list_memories |
List all with current scores |
delete_memory |
Hard delete |
get_memory_stats |
Dashboard stats |
consolidate_now |
Manual consolidation cycle |
How Decay Works
Combines ACT-R base-level activation (frequency) with FadeMem exponential decay (recency):
- ACT-R:
B = ln(Σ t_i^(-0.5))— more accesses = higher activation - FadeMem:
decay = exp(-0.1 · Δt^β)— STM decays fast (β=1.2), LTM slow (β=0.8) - Combined:
score = sigmoid(B) × decay
License
MIT