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.checkpoint.postgresshallowAsyncShallowPostgresSaver
    Class●Since v2.0

    AsyncShallowPostgresSaver

    Copy
    AsyncShallowPostgresSaver(
      self,
      conn: _ainternal.Conn,
      pipe: AsyncPipeline | None = None,
      serde: SerializerProtocol

    Bases

    BasePostgresSaver

    Constructors

    Attributes

    Methods

    Inherited fromBasePostgresSaver

    Attributes

    ASELECT_PENDING_SENDS_SQL: SELECT_PENDING_SENDS_SQL

    Methods

    Mget_next_version
    View source on GitHub
    |
    None
    =
    None
    )
    constructor
    __init__
    NameType
    conn_ainternal.Conn
    pipeAsyncPipeline | None
    serdeSerializerProtocol | None
    attribute
    SELECT_SQL: SELECT_SQL
    attribute
    MIGRATIONS: MIGRATIONS
    attribute
    UPSERT_CHECKPOINT_BLOBS_SQL: UPSERT_CHECKPOINT_BLOBS_SQL
    attribute
    UPSERT_CHECKPOINTS_SQL: UPSERT_CHECKPOINTS_SQL
    attribute
    UPSERT_CHECKPOINT_WRITES_SQL: UPSERT_CHECKPOINT_WRITES_SQL
    attribute
    INSERT_CHECKPOINT_WRITES_SQL: INSERT_CHECKPOINT_WRITES_SQL
    attribute
    lock: asyncio.Lock
    attribute
    conn: conn
    attribute
    pipe: pipe
    attribute
    loop
    attribute
    supports_pipeline
    method
    from_conn_string
    method
    setup
    method
    alist
    method
    aget_tuple
    method
    aput
    method
    aput_writes
    method
    list
    method
    get_tuple
    method
    put
    method
    put_writes

    A checkpoint saver that uses Postgres to store checkpoints asynchronously.

    This checkpointer ONLY stores the most recent checkpoint and does NOT retain any history. It is meant to be a light-weight drop-in replacement for the AsyncPostgresSaver that supports most of the LangGraph persistence functionality with the exception of time travel.

    Create a new AsyncShallowPostgresSaver instance from a connection string.

    Set up the checkpoint database asynchronously.

    This method creates the necessary tables in the Postgres database if they don't already exist and runs database migrations. It MUST be called directly by the user the first time checkpointer is used.

    List checkpoints from the database asynchronously.

    This method retrieves a list of checkpoint tuples from the Postgres database based on the provided config. For ShallowPostgresSaver, this method returns a list with ONLY the most recent checkpoint.

    Get a checkpoint tuple from the database asynchronously.

    This method retrieves a checkpoint tuple from the Postgres database based on the provided config (matching the thread ID in the config).

    Save a checkpoint to the database asynchronously.

    This method saves a checkpoint to the Postgres database. The checkpoint is associated with the provided config. For AsyncShallowPostgresSaver, this method saves ONLY the most recent checkpoint and overwrites a previous checkpoint, if it exists.

    Store intermediate writes linked to a checkpoint asynchronously.

    This method saves intermediate writes associated with a checkpoint to the database.

    List checkpoints from the database.

    This method retrieves a list of checkpoint tuples from the Postgres database based on the provided config. For ShallowPostgresSaver, this method returns a list with ONLY the most recent checkpoint.

    Get a checkpoint tuple from the database.

    This method retrieves a checkpoint tuple from the Postgres database based on the provided config (matching the thread ID in the config).

    Save a checkpoint to the database.

    This method saves a checkpoint to the Postgres database. The checkpoint is associated with the provided config. For AsyncShallowPostgresSaver, this method saves ONLY the most recent checkpoint and overwrites a previous checkpoint, if it exists.

    Store intermediate writes linked to a checkpoint.

    This method saves intermediate writes associated with a checkpoint to the database.