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.checkpointmemory
    Moduleā—Since v1.0

    memory

    Attributes

    attribute
    WRITES_IDX_MAP: dict
    attribute
    ChannelVersions: dict[str, str | int | float]
    attribute
    logger
    attribute
    MemorySaver: InMemorySaver

    Functions

    function
    get_checkpoint_id
    function
    get_checkpoint_metadata

    Classes

    View source on GitHub
    class
    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.
    class
    Checkpoint

    State snapshot at a given point in time.

    class
    CheckpointMetadata

    Metadata associated with a checkpoint.

    class
    CheckpointTuple

    A tuple containing a checkpoint and its associated data.

    class
    SerializerProtocol

    Protocol for serialization and deserialization of objects.

    • dumps_typed: Serialize an object to a tuple (type, bytes).
    • loads_typed: Deserialize an object from a tuple (type, bytes).

    Valid implementations include the pickle, json and orjson modules.

    class
    InMemorySaver

    An in-memory checkpoint saver.

    This checkpoint saver stores checkpoints in memory using a defaultdict.

    class
    PersistentDict

    Persistent dictionary with an API compatible with shelve and anydbm.

    The dict is kept in memory, so the dictionary operations run as fast as a regular dictionary.

    Write to disk is delayed until close or sync (similar to gdbm's fast mode).

    Input file format is automatically discovered. Output file format is selectable between pickle, json, and csv. All three serialization formats are backed by fast C implementations.

    Adapted from https://code.activestate.com/recipes/576642-persistent-dict-with-multiple-standard-file-format/

    Get checkpoint ID.

    Get checkpoint metadata in a backwards-compatible manner.