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:
BaseCheckpointSaver.delete_for_runs/adelete_for_runs: https://github.com/langchain-ai/langgraph/blob/main/libs/checkpoint/langgraph/checkpoint/base/\__init_\_.py- SQLite saver: https://github.com/langchain-ai/langgraph/blob/main/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/\__init_\_.py
- Async SQLite saver: langgraph/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py at main · langchain-ai/langgraph · GitHub
I searched existing issues and PRs. I did not find an issue specifically tracking the SQLite implementation, but I found related existing work:
- Existing conformance tests for
delete_for_runs: langgraph/libs/checkpoint-conformance/langgraph/checkpoint/conformance/spec/test_delete_for_runs.py at main · langchain-ai/langgraph · GitHub - Open PostgreSQL implementation PR: feat(checkpoint-postgres): add extended methods and conformance tests by hinthornw · Pull Request #6883 · langchain-ai/langgraph · GitHub
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_runstoSqliteSaver. - Add
adelete_for_runstoAsyncSqliteSaver. - Delete checkpoints whose metadata
run_idis 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?