Tiramemsu

Tiramemsu 0.13: memory you can undo

Release notes · 2 December 2026

Agents can already undo their code and their conversation. Claude Code rewinds, LangGraph forks from a checkpoint, sandboxes snapshot and restore. Their memory usually cannot go back. A bad sync, a hallucinated fact or a confused session stays until someone cleans it up by hand.

Tiramemsu 0.13.0 adds checkpoints, so an agent’s memory can be undone as well:

Checkpoints work on both engines, SQLite and redb, and in every package: Rust, Python, Node.js, the JSON bridge, the tm command line and the MCP server.

Upgrading. There is no file format change. Files from earlier releases open as they are, and the new features need no migration step.
cargo add [email protected] · pip install -U tiramemsu · npm install @tiramemsu/[email protected] · cargo install tiramemsu-cli tiramemsu-mcp

Checkpoints in one minute

Take a checkpoint, let something go wrong, look at what changed, and go back:

with db.transact() as tx:
    tx.tag("before-sync")              # names the last committed transaction

# ... the sync writes things it should not have ...

d = db.diff("before-sync")              # to "now" by default
db.preview_revert("before-sync")       # a dry run: what would change, and would it commit?

with db.transact() as tx:
    tx.revert_to("before-sync", tag_before="bad-sync")

db.diff("before-sync", by_content=True)  # added: [], removed: []
db.transact((tx) => { tx.tag("v1"); });

// ... later writes ...

const d = db.diff("v1");                    // { added, removed, superseded, complete }
db.asOf({ tag: "v1" }).triples();          // the memory as it was at v1
db.previewRevert("v1").wouldCommit;         // true
db.transact((tx) => { tx.revertTo("v1", { tagBefore: "pre" }); });
db.diff("v1", "now", { byContent: true }).added;  // []
db.transact(TxOptions::default(), |tx| tx.tag("clean", &TxRef::Now).map(|_| ()))?;

// ... later writes ...

let d = db.diff(&TxRef::parse("clean"), &TxRef::Now, &DiffOptions::default())?;
let preview = db.preview_revert(&TxRef::parse("clean"), &RevertOptions::default())?;
let report = db.revert_to(
    &TxRef::parse("clean"),
    &RevertOptions { tag_before: Some("oops".into()) },
)?;
// report.retracted, report.restored: [(original, copy)], report.t
$ tm tag mem.db clean
tagged 1 as "clean" (in tx 2)
$ tm import mem.db bad.nt
$ tm diff mem.db clean
diff tx 1 → tx 3: 2 added, 0 removed, 0 superseded
$ tm revert mem.db clean --dry-run
dry run: reverting to tx 1 would retract 2 and restore 0 statement(s); nothing written
$ tm revert mem.db clean --tag-before oops
reverted to tx 1 in tx 4: retracted 2, restored 0

A moment is a transaction number, now, or a tag name. Everything that takes a moment takes any of the three, including as_of, so db.as_of(tag="v1") is the memory as it was at v1.

For agents over MCP

The MCP server has three new tools, on by default:

An agent can mark the start of a task and report at the end exactly what it learned and what it corrected. The fourth tool, revert, can retract a great deal in one call, so the server lists it only when you start it with --allow-revert. Clients see it marked as destructive, and read-only mode refuses it even with the flag.

claude mcp add tiramemsu -- tiramemsu-mcp --db ./memory.db --allow-revert

What a revert does, briefly

A revert is one ordinary transaction:

  1. It retracts what is live now but was not live at the target.
  2. It asserts again what was live at the target but is not now, as new statements with their original content and valid time. Each copy links to its original with sys:restoredFrom, and the layers on it (confidence, sources, graph memberships) come back on the copy.
  3. It records sys:revertedTo on itself.

Every earlier view of the memory stays exactly as it was, so an auditor can still see the bad write, when it happened and what undid it. The memory’s rules still apply: unique predicates, schemas and enforced Datalog and ELPI constraints are checked at commit, and a revert that would break one fails as a whole.

How diff stays cheap, why a restored statement gets a new id, and what the property tests found are in How checkpoints work. A longer walk-through of a bad sync, undone step by step, is in Checkpoints for agent memory.

Also in 0.13.0

What is not in it

The full list is in the changelog.

Next: how checkpoints work →