agentmem is a governed memory system for long-lived coding agents. Its starting point is: AI coding assistants forget everything between sessions, repeat past mistakes, and cannot distinguish current rules from outdated ones; recovering after context compression is also painful. Most memory tools solve "storage"; agentmem solves "trust."
[Purpose and Positioning] agentmem is used to provide shared memory for coding agents such as Claude Code, Cursor, and Codex, so they know what still holds true. It emphasizes local-first, does not rely on cloud services, API keys, or vector databases, and uses only a .db file.
[Main Capabilities]
- Truth Governance: Every memory has a status used to measure how much it should be trusted. The statuses given in the material include hypothesis, active, validated, and deprecated, and it also mentions superseded. Without governance, agent memory accumulates outdated rules, contradictory content, and abandoned decisions; for example, a January voice setting was already overridden in March, but both are retrieved, and the LLM chooses randomly.
- Conflict Detection: Finds mutually contradictory memories. It detects topic overlap (Jaccard similarity), distinguishes duplicates from contradictions, performs sentence-level negation matching (not just keyword scanning), and distinguishes by severity between critical (both are active) and warning (one has been deprecated). The material mentions that the governance engine reduced conflicts from 1848 false positives to 11 real findings.
- Staleness Detection: Finds outdated memories by age (not updated for N days), missing source files (a referenced file has been deleted), and hash drift (source file content has changed but the memory has not been updated).
- Health Scoring: Gives the memory system a score from 0-100 based on dimensions such as conflicts, staleness percentage, orphaned references, deprecated weight, and whether validated memories exist.
- Provenance-Aware Sync: Syncs canonical markdown files into the database and tracks provenance. Same hash = skip (idempotent); different hash = update; section removed = deprecate (with reason); section restored = revive (reactivate a deprecated memory).
- Trust-Ranked Recall: recall() does not just findrelevant memories, but rather to find the most trustworthy relevant memories. After FTS5 retrieval returns candidates, each is scored as 25% relevance + 20% trust status + 20% source + 15% recency + 10% frequency + 10% confidence. Verified canonical memories rank above unsourced hypothetical memories; deprecated and superseded memories are completely excluded; and they are greedily packed according to a token budget.
- Project Scoping.
- Seven memory types, covering real agent workflows (the source material does not list the type names one by one).
[How to Use]
- Quick start: install according to the instructions for Claude Code / Cursor / Codex, restart the editor, and the agent will have 13 memory tools; you can run memory_health to confirm.
- Python-only users: you can run pip install quilmem, and no additional MCP dependencies are required; a Python API is also provided.
- MCP server: built into Claude Code, Cursor, and any MCP client. The Claude Code configuration example is .claude/settings.json.
- MCP tools: add_memory, search_memory, recall_memory, update_memory, delete_memory, list_memories, save_session, load_session, promote_memory, deprecate_memory, supersede_memory, memory_health, memory_conflicts.
- Teaching the agent to use memory: copy the agent instructions into CLAUDE.md, .cursorrules, or AGENTS.md to teach the agent the session protocol, trust hierarchy, and when to search and when to add.
[Applicable Scenarios] Aimed at long-lived coding agents, especially development workflows that want to retain correct rules across sessions, avoid repeating bugs, and need to distinguish current rules from outdated rules. The source material states that agentmem was built under more than 2 months of daily production use pressure: producing 65+ YouTube Shorts with zero repeated production bugs; 330+ memory-governed voicegeneration, FFmpeg assembly, image prompts, upload workflows; each bug is caught only once, fixed once, and never repeated.
[Technical Implementation] Storage uses SQLite's WAL mode (concurrent reads, thread-safe); search uses FTS5, with porter stemming and the unicode61 tokenizer; ranking uses a composite score: text relevance + trust status + source + recency + frequency + confidence; governance includes state lifecycle, conflict detection, staleness detection, and health scoring; synchronization is source-aware, supporting source hashes and resurrection. Zero infrastructure: no API keys, no cloud, no vector database, just one .db file.
[Limitations] The current source material does not provide pricing, charging model, platform support matrix, license agreement, or specific performance data; the complete names of the seven memory types are also not listed.