YourMemory
YourMemory is an MCP server that uses biological forgetting curves to automatically prune stale data and reinforce useful context for Claude agents. It beats Mem0 by 16% on benchmarks and runs fully locally with zero LLM overhead via spaCy and SQLite.
README
YourMemory
+16pp better recall than Mem0 on LoCoMo. 100% stale memory precision. Biologically-inspired memory decay for AI agents.
Persistent memory for Claude and any MCP-compatible AI — works like human memory. Important things stick, forgotten things fade, outdated facts get pruned automatically.
Early stage — feedback and ideas welcome.
Benchmarks
Evaluated against Mem0 (free tier) on the public LoCoMo dataset (Snap Research) — 10 conversation pairs, 200 QA pairs total.
| Metric | YourMemory | Mem0 | Margin |
|---|---|---|---|
| LoCoMo Recall@5 (200 QA pairs) | 34% | 18% | +16pp |
| Stale Memory Precision (5 contradiction pairs) | 100% | 0% | +100pp |
| Memories pruned (noise reduction) | 20% | 0% | — |
Full methodology and per-sample results in BENCHMARKS.md. Read the writeup: I built memory decay for AI agents using the Ebbinghaus forgetting curve
How it works
Ebbinghaus Forgetting Curve
base_λ = DECAY_RATES[category]
effective_λ = base_λ × (1 - importance × 0.8)
strength = importance × e^(-effective_λ × days) × (1 + recall_count × 0.2)
score = cosine_similarity × strength
Decay rate varies by category — failure memories fade fast, strategies persist longer:
| Category | base λ | survives without recall | use case |
|---|---|---|---|
strategy |
0.10 | ~38 days | What worked — successful patterns |
fact |
0.16 | ~24 days | User preferences, identity |
assumption |
0.20 | ~19 days | Inferred context |
failure |
0.35 | ~11 days | What went wrong — environment-specific errors |
Importance additionally modulates the decay rate within each category. Memories recalled frequently gain recall_count boosts that counteract decay. Memories below strength 0.05 are pruned automatically.
Setup
Zero infrastructure required — uses DuckDB out of the box. Two commands and you're done.
Supports Python 3.11, 3.12, 3.13, and 3.14.
1. Install
pip install yourmemory
All dependencies installed automatically. No clone, no Docker, no database setup.
2. Get your config
Run this once to get your exact config:
yourmemory-path
It prints your full executable path and a ready-to-paste config for any MCP client. Copy it.
3. Wire into your AI client
The database is created automatically at ~/.yourmemory/memories.duckdb on first use.
Claude Code
Add to ~/.claude/settings.json:
{
"mcpServers": {
"yourmemory": {
"command": "yourmemory"
}
}
}
Reload Claude Code (Cmd+Shift+P → Developer: Reload Window).
Cline (VS Code)
VS Code doesn't inherit your shell PATH. Run this in terminal to get the exact config to paste:
yourmemory-path
Then in Cline → MCP Servers → Edit MCP Settings, paste the output. It looks like:
{
"mcpServers": {
"yourmemory": {
"command": "/full/path/to/yourmemory",
"args": [],
"env": {
"YOURMEMORY_USER": "your_name",
"DATABASE_URL": ""
}
}
}
}
Restart Cline after saving.
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"yourmemory": {
"command": "/full/path/to/yourmemory",
"args": [],
"env": {
"YOURMEMORY_USER": "your_name",
"DATABASE_URL": ""
}
}
}
}
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"yourmemory": {
"command": "yourmemory"
}
}
}
Restart Claude Desktop.
Any MCP-compatible client
YourMemory is a standard stdio MCP server. Works with Claude Code, Claude Desktop, Cline, Cursor, Windsurf, Continue, and Zed. Use the full path from yourmemory-path if the client doesn't inherit shell PATH.
4. Add memory instructions to your project
Copy sample_CLAUDE.md into your project root as CLAUDE.md and replace:
YOUR_NAME— your name (e.g.Alice)YOUR_USER_ID— used to namespace memories (e.g.alice)
Claude will now follow the recall → store → update workflow automatically on every task.
PostgreSQL (optional — for teams or large datasets)
Install with Postgres support:
pip install yourmemory[postgres]
Then create a .env file:
DATABASE_URL=postgresql://YOUR_USER@localhost:5432/yourmemory
The backend is selected automatically — postgresql:// in DATABASE_URL → Postgres + pgvector, anything else → DuckDB.
macOS
brew install postgresql@16 pgvector && brew services start postgresql@16
createdb yourmemory
Ubuntu / Debian
sudo apt install postgresql postgresql-contrib postgresql-16-pgvector
createdb yourmemory
MCP Tools
| Tool | When to call |
|---|---|
recall_memory |
Start of every task — surface relevant context |
store_memory |
After learning a new preference, fact, failure, or strategy |
update_memory |
When a recalled memory is outdated or needs merging |
store_memory accepts an optional category parameter to control decay rate:
# Failure — decays in ~11 days (environment changes fast)
store_memory(
content="OAuth for client X fails — redirect URI must be app.example.com",
importance=0.6,
category="failure"
)
# Strategy — decays in ~38 days (successful patterns stay relevant)
store_memory(
content="Cursor pagination fixed the 30s timeout on large user queries",
importance=0.7,
category="strategy"
)
Example session
User: "I prefer tabs over spaces in all my Python projects"
Claude:
→ recall_memory("tabs spaces Python preferences") # nothing found
→ store_memory("Sachit prefers tabs over spaces in Python", importance=0.9, category="fact")
Next session:
→ recall_memory("Python formatting")
← {"content": "Sachit prefers tabs over spaces in Python", "strength": 0.87}
→ Claude now knows without being told again
Decay Job
Runs automatically every 24 hours on startup — no cron needed. Memories below strength 0.05 are pruned.
Stack
- DuckDB — default backend, zero setup, native vector similarity (same quality as pgvector)
- sentence-transformers — local embeddings (
all-mpnet-base-v2, 768 dims, no external service needed) - spaCy 3.8.13+ — local NLP for deduplication and categorization (Python 3.11–3.14 compatible)
- APScheduler — automatic 24h decay job
- MCP — Claude integration via Model Context Protocol
- PostgreSQL + pgvector — optional, for teams / large datasets
Architecture
Claude / Cline / Cursor / Any MCP client
│
├── recall_memory(query)
│ └── embed → cosine similarity → score = sim × strength → top-k
│
├── store_memory(content, importance, category?)
│ └── is_question? → reject
│ category: fact | assumption | failure | strategy
│ embed() → INSERT memories
│
└── update_memory(id, new_content)
└── embed(new_content) → UPDATE memories
DuckDB (default) PostgreSQL + pgvector (optional)
└── memories.duckdb └── memories table
├── embedding FLOAT[768] ├── embedding vector(768)
├── importance FLOAT ├── importance float
├── recall_count INTEGER ├── recall_count int
└── last_accessed_at └── last_accessed_at
Dataset Reference
Benchmarks use the LoCoMo dataset by Snap Research — a public long-context memory benchmark for multi-session dialogue.
Maharana et al. (2024). LoCoMo: Long Context Multimodal Benchmark for Dialogue. Snap Research.
License
Copyright 2026 Sachit Misra
Licensed under the Apache License, Version 2.0. You may use, modify, and distribute this software freely with attribution. Patent protection included — contributors cannot sue users over patent claims.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。