LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    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
    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

    Copy
    BaseCheckpointSaver(
      self,
      *,
      serde: SerializerProtocol | None = None
    )

    Bases

    Generic[V]

    Constructors

    Attributes

    Methods

    View source on GitHub
    constructor
    __init__
    NameType
    serdeSerializerProtocol | None
    attribute
    serde: SerializerProtocol
    attribute
    config_specs: list

    Define the configuration options for the checkpoint saver.

    method
    get

    Fetch a checkpoint using the given configuration.

    method
    get_tuple

    Fetch a checkpoint tuple using the given configuration.

    method
    list

    List checkpoints that match the given criteria.

    method
    put

    Store a checkpoint with its configuration and metadata.

    method
    put_writes

    Store intermediate writes linked to a checkpoint.

    method
    delete_thread

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

    method
    delete_for_runs

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

    method
    copy_thread

    Copy all checkpoints and writes from one thread to another.

    method
    prune

    Prune checkpoints for the given threads.

    method
    aget

    Asynchronously fetch a checkpoint using the given configuration.

    method
    aget_tuple

    Asynchronously fetch a checkpoint tuple using the given configuration.

    method
    alist

    Asynchronously list checkpoints that match the given criteria.

    method
    aput

    Asynchronously store a checkpoint with its configuration and metadata.

    method
    aput_writes

    Asynchronously store intermediate writes linked to a checkpoint.

    method
    adelete_thread

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

    method
    adelete_for_runs

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

    method
    acopy_thread

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

    method
    aprune

    Asynchronously prune checkpoints for the given threads.

    method
    get_next_version

    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.

    method
    with_allowlist

    Return a shallow clone with a derived msgpack allowlist.

    Note:

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

    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.