Skip to content

GthSqliteSaver

Defined in: packages/core/src/history/checkpointSaver.ts:328

A LangGraph BaseCheckpointSaver persisting to a node:sqlite database.

Obtain one through openCheckpointSaver, which is fail-soft; the constructor is private so there is no way to hold one whose tables were never created.

  • BaseCheckpointSaver

serde: SerializerProtocol

Defined in: node_modules/.pnpm/@langchain+langgraph-checkpoint@1.1.5_@langchain+core@1.2.13_openai@7.20.0_undici@8.11.2_ws@8.21.3_zod@4.6.5__ws@8.21.3_/node_modules/@langchain/langgraph-checkpoint/dist/base.d.ts:58

BaseCheckpointSaver.serde

close(): void

Defined in: packages/core/src/history/checkpointSaver.ts:447

Close every held connection (fail-soft), and drop the in-memory copy with them, so a closed saver answers no read from memory that it could not answer from disk.

void


deleteThread(threadId): Promise<void>

Defined in: packages/core/src/history/checkpointSaver.ts:859

Delete a thread’s state from memory and from disk: its file, whole (see removeThreadState).

string

Promise<void>

BaseCheckpointSaver.deleteThread


get(config): Promise<Checkpoint<string, string> | undefined>

Defined in: node_modules/.pnpm/@langchain+langgraph-checkpoint@1.1.5_@langchain+core@1.2.13_openai@7.20.0_undici@8.11.2_ws@8.21.3_zod@4.6.5__ws@8.21.3_/node_modules/@langchain/langgraph-checkpoint/dist/base.d.ts:65

RunnableConfig

Promise<Checkpoint<string, string> | undefined>

BaseCheckpointSaver.get


getDeltaChannelHistory(options): Promise<Record<string, DeltaChannelHistory>>

Defined in: node_modules/.pnpm/@langchain+langgraph-checkpoint@1.1.5_@langchain+core@1.2.13_openai@7.20.0_undici@8.11.2_ws@8.21.3_zod@4.6.5__ws@8.21.3_/node_modules/@langchain/langgraph-checkpoint/dist/base.d.ts:107

Walk the parent chain returning per-channel writes + seed, used to reconstruct DeltaChannel state from checkpoint_writes.

For each requested channel, walks ancestors of the checkpoint identified by config (following parentConfig) and accumulates the pending writes for that channel. The walk terminates per-channel at the nearest ancestor whose channel_values[ch] is populated; that value is returned as seed. If the walk reaches the root without finding a stored value, seed is omitted from that channel’s entry — the consumer treats the absence as “start empty”.

Walks the parent chain (not list({ before })): for forked threads, only on-path ancestors contribute.

The default implementation walks getTuple + parentConfig once for all channels — each ancestor visited once, not once per channel. Savers with direct storage access (e.g. MemorySaver) override for performance; the return contract is fixed here.

string[]

Channel names to walk for. Empty → empty mapping.

RunnableConfig

Configuration identifying the target checkpoint.

Promise<Record<string, DeltaChannelHistory>>

Per-channel DeltaChannelHistory for every requested name.

Beta. The signature, return shape, and interaction with DeltaSnapshot blobs may change. Override at your own risk; the default implementation will continue to work against the public BaseCheckpointSaver contract.

BaseCheckpointSaver.getDeltaChannelHistory


getNextVersion(current): number

Defined in: node_modules/.pnpm/@langchain+langgraph-checkpoint@1.1.5_@langchain+core@1.2.13_openai@7.20.0_undici@8.11.2_ws@8.21.3_zod@4.6.5__ws@8.21.3_/node_modules/@langchain/langgraph-checkpoint/dist/base.d.ts:117

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.

number | undefined

number

BaseCheckpointSaver.getNextVersion


getTuple(config): Promise<CheckpointTuple | undefined>

Defined in: packages/core/src/history/checkpointSaver.ts:511

RunnableConfig

Promise<CheckpointTuple | undefined>

BaseCheckpointSaver.getTuple


list(config, options?): AsyncGenerator<CheckpointTuple>

Defined in: packages/core/src/history/checkpointSaver.ts:588

History, read from SQLite only. Nothing in this repo lists a thread’s checkpoints (getStateHistory is never called), and memory holds only each thread’s latest checkpoint, so after a cut this omits what reached memory alone.

RunnableConfig

CheckpointListOptions

AsyncGenerator<CheckpointTuple>

BaseCheckpointSaver.list


put(config, checkpoint, metadata, _newVersions): Promise<RunnableConfig<Record<string, any>>>

Defined in: packages/core/src/history/checkpointSaver.ts:661

RunnableConfig

Checkpoint

CheckpointMetadata

ChannelVersions

Promise<RunnableConfig<Record<string, any>>>

BaseCheckpointSaver.put


putWrites(config, writes, taskId): Promise<void>

Defined in: packages/core/src/history/checkpointSaver.ts:742

Store intermediate writes linked to a checkpoint.

RunnableConfig

PendingWrite[]

string

Promise<void>

BaseCheckpointSaver.putWrites


reclaimUnresumableThreads(options?): ReclaimSummary

Defined in: packages/core/src/history/checkpointSaver.ts:877

GS2-107 — remove the state of every thread no conversation row names, past the grace window. The retention module owns the policy and the reasoning; this runs it over this saver’s store, releasing any connection this saver holds to a thread before its file is touched.

Every thread this saver wrote is excluded, always, on top of whatever the caller names. A caller cannot supply that set: the runner rotates threads without telling anyone, so the only place that knows which thread the session ended on is the object the writes went through. The union is the contract — excludeThreadIds adds to the protection and can never subtract from it.

readonly string[]

number

number

ReclaimSummary


storeStats(topN?): CheckpointStoreStats

Defined in: packages/core/src/history/checkpointSaver.ts:888

GS2-107 — what this saver’s store holds.

number

CheckpointStoreStats


toJSON(): string

Defined in: node_modules/.pnpm/@langchain+langgraph-checkpoint@1.1.5_@langchain+core@1.2.13_openai@7.20.0_undici@8.11.2_ws@8.21.3_zod@4.6.5__ws@8.21.3_/node_modules/@langchain/langgraph-checkpoint/dist/base.d.ts:64

Prevent JSON.stringify from traversing backend clients (e.g. pg Pool timers) when a checkpointer is present in runnable configurable.

string

BaseCheckpointSaver.toJSON


static open(storePath, options?): GthSqliteSaver | null

Defined in: packages/core/src/history/checkpointSaver.ts:434

Open the saver over the store at storePath, creating the store (and splitting a single-file store from an earlier release) as needed. Returns null on any failure — a store that cannot be created, a split another process is running, a path that is not a store — so the caller can fall back to a MemorySaver without a try/catch of its own. Thread files are opened lazily.

string

CheckpointSaverOptions = {}

GthSqliteSaver | null