A LangGraph checkpointer with provable thread deletion (signed erasure receipts) — feedback welcome

Hey all — sharing something I built for my own agents and finally cleaned up enough to put out there. I’d genuinely value feedback from anyone running stateful LangGraph in production.

The problem that started it. My agent persists user threads with a checkpointer: great. Then a user invokes their right to be forgotten (GDPR/CCPA), I call delete_thread(…), the rows vanish, and… I realized I had no way to prove it happened. If compliance or an auditor asks “show me user X’s thread was actually deleted,” the standard savers (Memory / SQLite / Postgres) sign nothing and attest nothing. Deletion is a side effect with no evidence.

So I wrote langgraph-checkpoint-grafomem — a drop-in checkpointer that wraps the saver you already use and adds two things: every checkpoint is Ed25519-signed (tamper-evident), and delete_thread emits a signed erasure receipt.

Usage — it wraps your existing saver, nothing else about how you build changes:

import sqlite3
from langgraph.checkpoint.sqlite import SqliteSaver
from grafomem_checkpoint import GrafomemSerializer, GrafomemCheckpointSaver

conn = sqlite3.connect(“memory.db”, check_same_thread=False)
inner = SqliteSaver(conn, serde=GrafomemSerializer(private_key, key_id=key_id, trusted_keys=trusted_keys))
saver = GrafomemCheckpointSaver(inner)
graph = builder.compile(checkpointer=saver)

#right to be forgotten, with proof:

saver.delete_thread(“user-123”)
receipt = saver.last_receipt(“user-123”)
assert receipt.verify(public_key) # signed proof of the erasure transition
print(receipt.to_json())

The receipt binds a hash of the thread’s entire checkpoint history before deletion to the empty state after it — so it commits to the specific data that was erased, and anyone with the public key can verify it, no database access required.

Being upfront about what it proves (I think this is the important part): it’s cryptographic proof that the erasure operation occurred, bound to a key and a timestamp. It is not a claim of media-level unrecoverability — your DB backups, WAL, and replicas are outside its control. So the honest statement is “we can prove this thread was erased on this date, signed and independently verifiable” — which, in my experience, is exactly the artifact a compliance review actually asks for. (If you’ve seen tools promise “guaranteed permanent deletion,” this is the version that’s actually true.)

Try it (Python 3.11+):

pip install langgraph-checkpoint-grafomem

Runnable reference agent (chat, /recall, /forget → verified receipt): GitHub - GNS-Foundation/grafomem-langgraph-example · GitHub
It’s Fair Source — free to self-host and modify, your own signing keys, no cloud dependency.

What I’m actually looking for: one or two of you running LangGraph with a real deletion or audit requirement to try it and tell me where the API fights your setup, or where the receipt doesn’t fit your compliance flow. Open an issue or just reply here — that feedback is the thing I want most right now.

(If you’re curious why the underlying memory is designed the way it is — the two-tier, hippocampus-and-neocortex story — I wrote it up here: https://medium.com/@camilo.ayerbe/your-brain-already-solved-ais-two-biggest-memory-problems-a2145e10a7aa.)

Thanks for reading — happy to answer anything.

The Ed25519 receipt does buy you tamper-evidence and non-repudiation for the claimed transition. I’d be careful calling it proof of erasure, though. It proves the key holder signed a claim tied to that pre-image hash, not that the data is absent. SQLite freelist/WAL pages, Postgres dead tuples before VACUUM, replicas, snapshots, and backups can all survive outside the wrapper. A per-thread encryption key would make this stronger: delete_thread destroys the key, and the receipt commits to that destruction, covering encrypted copies you no longer control. One practical question: are receipts stored in an append-only log, so an auditor can distinguish a deletion from delete_thread never being called?

@capitaharlock — thank you for this. You were right on all three points, so rather than just agree I went and built them. All of this is now live (v1.1.0 + v1.2.0: pip install -U langgraph-checkpoint-grafomem).

On “proof of erasure” vs tamper-evidence — agreed, and to correct my original post: the receipt used to bind only the fact of the transition (a fixed label + timestamp), not the data. It now binds a SHA-256 digest of the thread’s checkpoint history as it stood immediately before deletion, so it commits to the specific data erased — verifiable with the public key, no DB access.

On the append-only log — your practical question (can an auditor tell a real deletion from delete_thread never being called?). There’s now a durable, hash-chained erasure log: each erasure is one chained entry, reordering or dropping one is detectable, the signature inside each entry catches forgery, and a thread that was never deleted simply has no entry. It survives restart.

On the residuals — your per-thread-key idea — this is the one I’m most glad you pushed. It’s now implemented as opt-in per-thread crypto-erasure: each thread’s checkpoints are encrypted under a per-thread key (wrapped under a master KEK), delete_thread destroys that key, and the receipt commits to the destruction (after = key_destroyed:<fingerprint>). A retained ciphertext copy — a WAL page, a replica, a backup — decrypts before deletion and raises ThreadKeyDestroyed after. So the residual copies you correctly flagged become undecryptable without the key.

Honest about the ceiling: it’s key-destruction crypto-erasure, not a guarantee the physical ciphertext bytes were overwritten, and it leans on the KEK and key store being managed correctly. It’s also opt-in — without a key manager the default stays signed-but-plaintext, backward compatible. The design boundary (encryption stays in the adapter; the core signing format is untouched) is written up in an ADR if you ever want to poke at it.

Genuinely the most useful review I’ve had on this. If you kick the tires on the crypto-erasure path and the API fights your setup, I’d want to hear it.

@cayerbe the chained erasure log with a signature in each entry covers most of what i’d want an auditor to check. what i’d look at next is which process holds the signing key and the write handle to that log. if it’s the same process that calls delete_thread, a buggy or compromised caller can sign a receipt that verifies fine, because the signer is legit. in my guardrail the agent process gets no write handle to the ledger at all, a separate component does the appends, and sqlite triggers reject update and delete on the table. splitting the signer from the caller narrows what a receipt has to be trusted for. in your wrapper does the signing key live in the same process as the saver, or can it sit behind a separate signer?