From 44805588b6ded8ce56fb17ac88cc020260b031aa Mon Sep 17 00:00:00 2001 From: Quanzheng Long Date: Thu, 7 May 2026 17:10:20 -0700 Subject: [PATCH] docs: clarify get_delta_channel_keepset is a basic reference implementation Make it clear that custom backends may override with a more efficient version but the default works correctly for any saver. Co-authored-by: Cursor --- libs/checkpoint/langgraph/checkpoint/base/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/checkpoint/langgraph/checkpoint/base/__init__.py b/libs/checkpoint/langgraph/checkpoint/base/__init__.py index 497a5b8f5..e588a6073 100644 --- a/libs/checkpoint/langgraph/checkpoint/base/__init__.py +++ b/libs/checkpoint/langgraph/checkpoint/base/__init__.py @@ -711,6 +711,15 @@ class BaseCheckpointSaver(Generic[V]): ) delete_rows_not_in(keep) + Note: + The default implementation here uses repeated `get_tuple` calls + to walk the parent chain. This is a basic reference implementation + suitable for low-frequency maintenance operations (prune, etc.). + Custom checkpointer backends may override with a more efficient + version tailored to their data model (e.g. a single SQL query + with a recursive CTE), but it is not required — the default works + correctly for any saver that implements `get_tuple`. + Args: config: Configuration identifying the target checkpoint. channels: Channel names whose delta history must be preserved.