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.checkpoint.postgresPostgresSaverget_tuple
    Method●Since v1.0

    get_tuple

    Get a checkpoint tuple from the database.

    This method retrieves a checkpoint tuple from the Postgres database based on the provided config. If the config contains a checkpoint_id key, the checkpoint with the matching thread ID and timestamp is retrieved. Otherwise, the latest checkpoint for the given thread ID is retrieved.

    Copy
    get_tuple(
        self,
        config: RunnableConfig,
    ) -> CheckpointTuple | None

    Examples:

    Basic:

    config = {"configurable": {"thread_id": "1"}} checkpoint_tuple = memory.get_tuple(config) print(checkpoint_tuple) CheckpointTuple(...)

    With timestamp:

    config = { ... "configurable": { ... "thread_id": "1", ... "checkpoint_ns": "", ... "checkpoint_id": "1ef4f797-8335-6428-8001-8a1503f9b875", ... } ... } checkpoint_tuple = memory.get_tuple(config) print(checkpoint_tuple) CheckpointTuple(...)

    Parameters

    NameTypeDescription
    config*RunnableConfig

    The config to use for retrieving the checkpoint.

    View source on GitHub