agentmem
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Shared memory for Claude Code, Cursor, and Codex that knows what's still true. Save sessions, catch stale and conflicting rules, and stop your agent from repeating old mistakes.
The Problem
Your AI coding assistant forgets everything between sessions. It repeats old mistakes. It can't tell current rules from outdated ones. Context compresses and recovery is painful.
Most memory tools solve **storage**. agentmem solves **trust**.
Get Started (Claude Code / Cursor / Codex)
That's it. Restart your editor. Your agent now has 13 memory tools. Run memory_health to confirm.
> **Python-only?** pip install quilmem works without the MCP extra. See the Python API below.
60-Second Demo
What Makes This Different
**Other memory tools store things.** agentmem knows what's still true.
| | Mem0 | Letta | Mengram | agentmem |
|---|---|---|---|---|
| Memory storage | Yes | Yes | Yes | Yes |
| Full-text search | Vector | Agent-driven | Knowledge graph | **FTS5** |
| Memory lifecycle states | No | Partial | No | **hypothesis -> active -> validated -> deprecated -> superseded** |
| Conflict detection | No | No | Partial | **Built-in** |
| Staleness detection | No | No | No | **Built-in** |
| Health scoring | No | No | No | **Built-in** |
| Provenance tracking | No | No | No | **source_path + source_hash** |
| Trust-ranked recall | No | No | No | **Validated > active > hypothesis** |
| Human-readable source files | No | No | No | **Canonical markdown** |
| Local-first, zero infrastructure | No | Self-host option | Self-host option | **Yes, always** |
| MCP server | Separate | Separate | Yes | **Built-in** |
Truth Governance
The core idea: every memory has a **status** that tracks how much you should trust it.
**Why this matters:** Without governance, your agent's memory accumulates stale rules, contradictions, and outdated decisions. It doesn't know that the voice setting from January was overridden in March. It retrieves both and the LLM picks randomly. Governed memory solves this.
Conflict Detection
agentmem finds memories that contradict each other:
- Detects topic overlap (Jaccard similarity)
- Separates **duplicates** from **contradictions**
- Sentence-level negation matching (not just keyword scanning)
- Severity: critical (both active) vs warning (one deprecated)
Staleness Detection
Finds outdated memories by:
- Age (not updated in N days)
- Source file missing (referenced file was deleted)
- Hash drift (source file content changed but memory wasn't updated)
Health Check
Scores your memory system 0-100 based on: conflicts, stale percentage, orphaned references, deprecated weight, and whether you have any validated memories.
Provenance-Aware Sync
Sync canonical markdown files into the DB with source tracking:
The sync engine:
- **Same hash = skip** (idempotent, re-running changes nothing)
- **Different hash = update** (source file changed)
- **Section removed = deprecate** (with reason)
- **Section restored = resurrect** (reactivates deprecated memory)
Three Interfaces
Python API
CLI
MCP Server
Built-in Model Context Protocol server for Claude Code, Cursor, and any MCP client.