LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph.checkpointbaseBaseCheckpointSaver
    Class●Since v1.0

    BaseCheckpointSaver

    Base class for creating a graph checkpointer.

    Checkpointers allow LangGraph agents to persist their state within and across multiple interactions.

    When a checkpointer is configured, you should pass a thread_id in the config when invoking the graph:

    config = {"configurable": {"thread_id": "my-thread"}}
    graph.invoke(inputs, config)

    The thread_id is the primary key used to store and retrieve checkpoints. Without it, the checkpointer cannot save state, resume from interrupts, or enable time-travel debugging.

    How you choose thread_id depends on your use case:

    • Single-shot workflows: Use a unique ID (e.g., uuid4) for each run when executions are independent.
    • Conversational memory: Reuse the same thread_id across invocations to accumulate state (e.g., chat history) within a conversation.
    Copy
    BaseCheckpointSaver(
      self,
      *,
      serde: SerializerProtocol | None = None
    )

    Bases

    Generic[V]

    Note:

    When creating a custom checkpoint saver, consider implementing async versions to avoid blocking the main thread.

    Used in Docs

    • Checkpointers

    Constructors

    constructor
    __init__
    NameType
    serdeSerializerProtocol | None

    Attributes

    attribute
    serde: SerializerProtocol
    attribute
    config_specs: list

    Methods

    method
    get
    method
    get_tuple
    method
    list
    method
    put
    method
    put_writes
    method
    delete_thread
    method
    delete_for_runs
    method
    copy_thread
    method
    prune
    method
    aget
    method
    aget_tuple
    method
    alist
    method
    aput
    method
    aput_writes
    method
    adelete_thread
    method
    adelete_for_runs
    method
    acopy_thread
    method
    aprune
    method
    get_delta_channel_history
    method
    aget_delta_channel_history
    method
    get_next_version
    method
    with_allowlist
    View source on GitHub

    Define the configuration options for the checkpoint saver.

    Fetch a checkpoint using the given configuration.

    Fetch a checkpoint tuple using the given configuration.

    List checkpoints that match the given criteria.

    Store a checkpoint with its configuration and metadata.

    Store intermediate writes linked to a checkpoint.

    Delete all checkpoints and writes associated with a specific thread ID.

    Delete all checkpoints and writes associated with the given run IDs.

    Copy all checkpoints and writes from one thread to another.

    Prune checkpoints for the given threads.

    Asynchronously fetch a checkpoint using the given configuration.

    Asynchronously fetch a checkpoint tuple using the given configuration.

    Asynchronously list checkpoints that match the given criteria.

    Asynchronously store a checkpoint with its configuration and metadata.

    Asynchronously store intermediate writes linked to a checkpoint.

    Delete all checkpoints and writes associated with a specific thread ID.

    Asynchronously delete all checkpoints and writes for the given run IDs.

    Asynchronously copy all checkpoints and writes from one thread to another.

    Asynchronously prune checkpoints for the given threads.

    Walk the parent chain returning per-channel writes + seed.

    Beta

    This method is part of the DeltaChannel support surface and is in beta. The signature, return shape (DeltaChannelHistory), and interaction with _DeltaSnapshot blobs may change. Override at your own risk; the default implementation will continue to work against the public BaseCheckpointSaver contract.

    For each requested channel, walks ancestors of the checkpoint identified by config (following parent_config) and accumulates pending_writes for that channel. The walk terminates per-channel at the nearest ancestor whose channel_values[ch] is populated; that value is returned as seed. If the walk reaches the root without finding a stored value, seed is omitted from that channel's entry — the consumer treats the absence as "start empty."

    Walks the parent chain (not list(before=...)): for forked threads, only on-path ancestors contribute.

    The default implementation walks get_tuple + parent_config once for all channels — each ancestor visited once, not once per channel. Savers with direct storage access (InMemorySaver, PostgresSaver) override for performance; the return contract is fixed here.

    Async version of get_delta_channel_history.

    Beta

    This method is part of the DeltaChannel support surface and is in beta. See get_delta_channel_history for caveats.

    Generate the next version ID for a channel.

    Default is to use integer versions, incrementing by 1.

    If you override, you can use str/int/float versions, as long as they are monotonically increasing.

    Return a shallow clone with a derived msgpack allowlist.