Labsco
MCP SERVER

Anneal Memory

by phillipclapham

Record what happened during a session, compress it at the boundary into a continuity file, and let only patterns that cite real episodes graduate into long-term memory.

Agent MemoryVerified
Summary
Patterns have to cite the episodes that produced them, and the server checks the IDs.

This is the part that separates it from a store that just keeps things: to graduate, a pattern names specific episode IDs, and the server verifies they exist in that wrap's frozen snapshot, so re-citing a previous session's episodes fails outright. The explanation attached to a citation must share at least two meaningful words with the episode it cites, and one episode ID cited three or more times in a wrap raises a gaming flag. Every mutation appends to a SHA-256 hash-chained log that breaks visibly if edited. The author is unusually direct about the ceiling: these checks catch fabricated and replayed evidence, not an explanation that clears the word test while misreading what the episode said.

What it is

A local memory store for agents, built around one loop: record episodes while working, compress them at session end, load the compressed continuity at session start. 16 tools — 6 for memory, 2 for the crystallized long-term tier, 8 for prospective loops. The store is a local file with no vendor in between, and the Python library underneath it has no dependencies outside the standard library.

What you get
  • Typed episodes recorded as they happen — decisions, observations, tensions, questions, outcomes — with the reasoning rather than just the fact, and recall over them by time range, type, source or keyword (record, recall).
  • The compression step itself: prepare_wrap returns everything since the last wrap plus the current continuity, stale-pattern warnings and association context, and save_continuity validates what comes back — exactly four sections, citations checked against real episode IDs — before it is written (prepare_wrap, save_continuity).
  • Memory health on demand: episode counts total and since the last wrap, wrap history, continuity file size, episodes by type, and association network metrics (status).
  • Deletion for content that should not exist, such as PII recorded by accident, cascading to the associations built on it and logged in the audit trail (delete_episode).
  • A crystallized tier that keeps proven patterns out of the always-loaded working set: an always-on name-and-one-clause index of everything that graduated, and on-demand recall of the bodies, scored corpus-aware so rare distinctive terms outweigh common process words (crystal_index, crystal_recall).
  • A separate prospective layer for open loops that must resolve rather than accumulate — a task, a question or a thought planted as a spore, ranked by tier, salience and read-time germination, engaged without resolving, edited in place, and closed either downward as done, dropped or composted, or upward with a pointer to what it became (spore_add, spore_list, spore_get, spore_touch, spore_update, spore_descend, spore_ascend, spore_surface).
Requirements

Python — `pip install anneal-memory`, or run it with uvx. The MCP server is one command, `anneal-memory --project-name MyProject serve`, with the flags before the `serve` subcommand. It also expects an instructions snippet in the harness's own instructions file (CLAUDE.md, AGENTS.md, GEMINI.md); without it the tools are present but the agent does not know the workflow they belong to. One process per store: Store is documented as not thread-safe and not reentrant, and pointing two of them at one database breaks the audit chain by construction.

Setup effort

One command — uvx anneal-memory --project-name MyProject serve