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.sqliteaio
    Module●Since v1.0

    aio

    Attributes

    attribute
    DELTA_STAGE1_SQL: str
    attribute
    T

    Functions

    function
    build_delta_channels_writes_history

    Demux stage-2 rows per channel; produce per-channel histories.

    Stage-2 rows are (checkpoint_id, channel, task_id, idx, type, value). Final write order is oldest→newest globally and (task_id, idx) within a checkpoint, matching the contract on DeltaChannelHistory.writes.

    seed is omitted when the walk reached a true root with no snapshot found (channel never entered seeded); consumers treat absence as "start empty".

    function
    build_delta_stage2_sql

    Stage-2 per-channel UNION ALL fetching writes from writes.

    One branch per channel with a non-empty chain. Each branch inlines its own IN (?, ?, ...) placeholder list because sqlite has no array-bind equivalent of postgres's = ANY(%s). Caller passes parameters in matching order: [thread_id, checkpoint_ns, channel, *chain_cids] per branch.

    Returns an empty string when no channel has a chain (caller skips executing in that case). Per-channel UNION ALL avoids the over-fetch of a single channel = ANY(channels) filter when channels have different chain depths — same rationale as postgres.

    function
    step_walk_with_row

    Process one streamed stage-1 row in the merged ancestor walk.

    The cursor returns (cid, parent_cid, type, blob) rows in checkpoint_id DESC order starting at target. The first row is target itself; we read its parent_cid to seed the walk and otherwise skip it (target's own writes/seed are not part of the contract).

    For each subsequent row, if cid matches the walk's current position, we deserialize the blob, append the cid to every not-yet-seeded channel's chain, and check channel_values for seeds. The deserialized checkpoint is dropped before advancing — no cross-row cache, so peak in-flight is one deserialized checkpoint.

    Off-path rows (different branch on the same thread) advance the cursor without doing any work.

    Returns True when every requested channel is seeded — the caller can stop iterating and close the cursor.

    function
    search_where

    Return WHERE clause predicates for (a)search() given metadata filter and before config.

    This method returns a tuple of a string and a tuple of values. The string is the parametered WHERE clause predicate (including the WHERE keyword): "WHERE column1 = ? AND column2 IS ?". The tuple of values contains the values for each of the corresponding parameters.

    Classes

    class
    AsyncSqliteSaver

    An asynchronous checkpoint saver that stores checkpoints in a SQLite database.

    This class provides an asynchronous interface for saving and retrieving checkpoints using a SQLite database. It's designed for use in asynchronous environments and offers better performance for I/O-bound operations compared to synchronous alternatives.

    View source on GitHub