Checkpoint cleanup

Hi @Samerlkhodary ,

:one: ttl: "keep_latest"

Yes — it keeps:

  • The thread

  • The latest checkpoint per namespace

And automatically removes older checkpoints that are no longer needed for future runs. So you don’t need to manually manage old checkpoints in most cases.


:two: What about checkpoint_writes?

You should not manually delete checkpoint write entries.

Even if you’re keeping only the latest checkpoint:

  • Writes are part of the internal consistency model

  • They support replay / time-travel

  • Removing them manually can corrupt state recovery

If you’re using keep_latest, let LangGraph handle cleanup safely.


Important nuance (from earlier discussion)

If you manually delete:

  • Subgraph checkpoints (non-empty namespace)

  • But keep the parent

You risk breaking resume flows (especially HIL interrupts).

So best practice:

:backhand_index_pointing_right: Use keep_latest
:backhand_index_pointing_right: Don’t manually prune writes
:backhand_index_pointing_right: Let the runtime manage persistence integrity

That keeps your DB smaller without risking broken resumes :+1: