Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

AI Agents · Const

Checkpoint

Checkpoint is a point-in-time snapshot of LangGraph state. Checkpointers persist snapshots per thread, enabling memory, resumption, human-in-the-loop workflows, and recovery.

How it works

A checkpoint is a snapshot of graph state at a particular execution point. A checkpointer persists these snapshots, associates them with a thread, and can later retrieve or list them; this supports resuming execution, conversational memory, human review, and recovery after failures.

Syntax

interface Checkpoint { v: number; id: string; ts: string; channel_values: Record<string, unknown>; channel_versions: Record<string, number | string>; versions_seen: Record<string, Record<string, number | string>>; pending_sends: unknown[]; }

Returns

A persisted checkpoint is represented as a checkpoint tuple containing the checkpoint and associated configuration, metadata, and pending writes.

Key points

  • A checkpoint captures the graph's state at one execution point.
  • Checkpointers are the persistence mechanism used to save graph state.
  • The checkpointer API supports working with saved graph state.
  • A configured checkpointer records state after each superstep.
  • Threads group checkpoints belonging to one logical run or conversation.
  • Custom checkpointers must implement the BaseCheckpointSaver contract.

Common mistakes

  • A thread identifier is required when invoking a graph that uses checkpointing; a checkpoint identifier is optional.
  • Failed executions can leave pending writes, so resuming can avoid rerunning nodes that already completed successfully.

Example: Persist graph state by thread

import { MemorySaver } from "@langchain/langgraph";
import { StateGraph, Annotation } from "@langchain/langgraph";

const State = Annotation.Root({ count: Annotation<number>() });
const checkpointer = new MemorySaver();
const graph = new StateGraph(State)
  .addNode("increment", (state) => ({ count: state.count + 1 }))
  .addEdge("__start__", "increment")
  .compile({ checkpointer });

await graph.invoke({ count: 0 }, {
  configurable: { thread_id: "demo" },
});

Compiles a graph with a checkpointer so its state is saved for the specified thread.

When to use it

Conversation memory

Preserve conversational state across invocations.

Human-in-the-loop workflows

Pause execution for approval or review and continue later.

Fault-tolerant execution

Resume from saved state after a node or process failure.

Debugging and time travel

Inspect or replay earlier graph states.

  • BaseCheckpointSaver
  • CheckpointTuple
  • SerializerProtocol
  • thread_id
  • checkpoint_id

Source: @langchain/langgraph-checkpoint. Checked 2026-10-15.