Proposal: implement delete_for_runs for SQLite checkpoint savers

Hi maintainers,

I would like to contribute support for delete_for_runs / adelete_for_runs to the SQLite checkpoint savers.

Problem

While building with LangGraph + SQLite, I wanted to delete checkpoints associated with a few specific runs. I noticed that BaseCheckpointSaver already exposes delete_for_runs / adelete_for_runs, and checkpoint metadata already includes run_id, but the SQLite checkpoint savers do not currently implement these methods.

Relevant code:

I searched existing issues and PRs. I did not find an issue specifically tracking the SQLite implementation, but I found related existing work:

PR #6883 appears to cover the Postgres checkpoint saver, so I would like to focus this proposal only on SQLite.

Proposal

Implement delete_for_runs support for the SQLite checkpoint savers:

  • Add delete_for_runs to SqliteSaver.
  • Add adelete_for_runs to AsyncSqliteSaver.
  • Delete checkpoints whose metadata run_id is in the provided run IDs.
  • Delete associated pending writes for those checkpoints.
  • Preserve checkpoints from unrelated runs.
  • Treat an empty list or unknown run IDs as no-op.
  • Support deletion across checkpoint namespaces, matching the existing conformance behavior.

Testing

The repository already has conformance tests for this capability.

My plan is to implement the SQLite methods so they pass the existing delete_for_runs conformance tests. If needed, I can also add SQLite-specific tests in libs/checkpoint-sqlite/tests to make sure both SqliteSaver and AsyncSqliteSaver are covered.

If maintainers agree with this direction, could this be tracked in a GitHub issue and assigned to me before I open a PR?

@Crab-Dave I would encourage you to open this issue yourself on GitHub - langchain-ai/langgraph: Build resilient language agents as graphs. · GitHub as well, so the issue gets assigned to you.

Thanks for the guidance!

I opened the GitHub issue here: [Feature] Add delete_for_runs support for SQLite checkpoint savers · Issue #7644 · langchain-ai/langgraph · GitHub

Could you or another maintainer assign it to me when you have a chance? I’ll wait for the assignment before opening a PR, to follow the external contribution rules.

@Crab-Dave ,
A maintainer will assign.