Two-layer memory for AI agents with an immune system. Zero dependencies.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Anneal Memory.
recordWhen something important happens β a decision, observation, tension, question, outcome, or context change
recallBefore making decisions that might have prior context. Query by time, type, keyword, or ID
prepare_wrapAt session end β returns episodes + current continuity + association context + compression instructions
save_continuityAfter compressing β server validates structure, citations, records associations, applies decay, and saves
delete_episodeRemove content that should not exist (PII, sensitive data). Cascades to associations. Logged in audit trail (best-effort: the deletion is never failed by an audit-write failure; check `status().audit_write_failures` when the log is your evidence β a loss *recorded* there survives the process, so aβ¦
statusCheck memory health: episode counts, wrap history, continuity size, association network metrics
Living memory for AI agents. Episodes compress into identity.
Memory without grounding is amplification infrastructure.
Persistent user memory profiles increase agent sycophancy 16β45% across models (Gemini 2.5 Pro at 45%, others lower). Production deployments accumulate 97.8% junk entries within weeks. Clinical research documents memory scaffolding delusions across sessions. The failure mode here isn't memory. It's memory with nothing checking what gets kept.
anneal-memory adds structural defenses at the citation layer that the systems surveyed below don't ship. Patterns earn promotion through cited episode evidence with lexical-overlap explanation-grounding, fabricated citations get demoted, per-ID citation gaming surfaces a flag, replay attempts against stale episodes fail by construction, and the audit chain is SHA-256 hash-chained and tamper-evident. Stale patterns surface for the agent to act on; associations form through consolidation. These are narrow, structural primitives β not a complete defense against every form of memory drift. See Honest scope below for what these primitives catch and what they don't.
And it's memory you own and govern. A local store, zero dependencies, no vendor in the loop β you decide what graduates into long-term memory, every change is recorded in a tamper-evident chain (best-effort on the write side β see Hash-chained audit trail for what verify can and cannot see), and the consolidation step that rewrites an agent's identity is gated to a human, not run unbidden (the Single-consolidator gate below). Own the substrate; govern what enters it.
Four cognitive layers β episodic store, compressed continuity, Hebbian associations, affective state tracking β plus two sibling stores: prospective spores (what the agent intends to do next) and a crystallized pattern store (graduated wisdom held out of always-loaded context and recalled on cue, so a large body of proven knowledge stays effective without clogging attention). Together they implement Complementary Learning Systems β see The Memory Architecture below. Zero dependencies (Python stdlib only). Works with any agent framework.
The library is the core product. Import it, use it in any framework or script.
See Library Quickstart for the full guide.
Inspect, debug, and manage agent memory from the command line β a full operator CLI with machine-readable --json output. Agents with shell access (Claude Code, Aider, etc.) can use the CLI directly for the full memory workflow.
See examples/agent-instructions.lean.cli.example for the agent workflow snippet.
For MCP-capable agent harnesses β Claude Code, Codex, Gemini CLI, Cursor, Windsurf, and others.
The server is one command β anneal-memory --project-name MyProject serve β wired into the harness's MCP config. The serve subcommand starts the MCP server; --project-name (and optional --db) are global flags and come before serve. Each harness has its own config file and format:
Claude Code / Cursor / Windsurf β mcpServers JSON (the editor's MCP settings, or a project .mcp.json):
Codex β ~/.codex/config.toml (or a project .codex/config.toml):
Gemini CLI β ~/.gemini/settings.json (or a project .gemini/settings.json):
Then add the agent-instructions snippet β agent-instructions.lean.example (the always-loaded baseline) or the .full.example reference β to the harness's instructions file (CLAUDE.md for Claude Code, AGENTS.md for Codex, GEMINI.md for Gemini CLI). It teaches the agent when and how to use the memory tools; without it the tools are available but the agent won't know the cognitive workflow. (See Claude Code / agent-harness adopters below for the lean/Skill/full layering.)
Pinned install:
uvxfetches the latest published version on each run. For a pinned install,pip install anneal-memory, then set"command": "anneal-memory"with"args": ["--project-name", "MyProject", "serve"]β or pointcommandat an absolute path to the installed binary.
CLI and MCP are thin transport adapters over the same library β not separate implementations. Every access pattern calls the same prepare_wrap(store) and validated_save_continuity(store, text) pipeline under the hood, preserving the same workflow: record episodes during work β compress at session boundaries β load continuity at session start. The agent that records is the agent that compresses; that compression can't be delegated.
| Library | CLI | MCP | |
|---|---|---|---|
| Install | pip install anneal-memory | Same | uvx anneal-memory or same |
| Record | store.record(content, type) | anneal-memory record "..." --type T | record tool |
| Recall | store.recall(keyword=...) | anneal-memory search "..." | recall tool |
| Compress | prepare_wrap(store) β agent β validated_save_continuity(store, text) | prepare-wrap β agent β save-continuity | prepare_wrap β agent β save_continuity |
| Best for | Framework integration, custom agents | Agents with shell access, operators | MCP-enabled editors |
anneal-memory works with any agent framework through the Python library. Each guide below shows where to call the four core functions β record(), recall(), prepare_wrap(), validated_save_continuity() β within the framework's lifecycle.
| Framework | Integration Point | Guide |
|---|---|---|
| LangGraph / LangChain | AgentMiddleware (before/after agent + model) | docs/integrations/langgraph.md |
| CrewAI | BaseEventListener (event bus) | docs/integrations/crewai.md |
| OpenAI Agents SDK | RunHooks (agent lifecycle) | docs/integrations/openai-agents.md |
| Anthropic Agents SDK | agent-instructions snippet + Stop hook | docs/integrations/anthropic-agents.md |
| Google ADK | Callbacks + custom MemoryService | docs/integrations/google-adk.md |
| Pydantic AI | AbstractCapability with Hooks | docs/integrations/pydantic-ai.md |
| smolagents | step_callbacks dict | docs/integrations/smolagents.md |
| LlamaIndex | Instrumentation BaseEventHandler | docs/integrations/llamaindex.md |
| Haystack | Custom Tracer | docs/integrations/haystack.md |
| CAMEL-AI | WorkforceCallback | docs/integrations/camel-ai.md |
| AutoGen / AG2 | register_hook() | docs/integrations/autogen.md |
| DSPy | BaseCallback | docs/integrations/dspy.md |
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/anneal-memory)<a href="https://allmcps.com/mcp/anneal-memory"><img src="https://allmcps.com/api/badge/anneal-memory?style=directory" alt="Anneal Memory on AllMCPs" /></a>