Agent skill · software engineering · jeremylongshore

langchain-langgraph-checkpointing

Persist LangGraph agent state correctly with MemorySaver and PostgresSaver\

Why this skill is useful

Provides specific implementation details and patterns for checkpointing in LangGraph using Postgres, which the AI wouldn't reliably generate on its own.

What it needs

Requires langchain-core, langgraph, langgraph-checkpoint-postgres, python installed locally. About 7k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

LangGraph Checkpointing (Python) Overview A chat agent that "keeps introducing itself" is almost always P16. The caller invokes graph.invoke(state) without passing config={"configurable": {"threadid": ...}} — LangGraph's checkpointer silently spawns a fresh state per call. No error, no warning, no log line. The user sees it; the code does not. That is one of five separate checkpointing pitfalls this skill covers: P16 — missing threadid silently resets memory P17 — interruptbefore raises TypeError when state holds non-JSON values (datetime, Decimal, custom classes) — and it raises at the interrupt boundary, not when the bad value was first assigned, so the traceback points at the wrong line P20 — PostgresSaver does not auto-migrate checkpoint schema; upgrading langgraph silently reads old checkpoints as empty state P40 — ConversationBufferMemory and the rest of legacy chat memory were removed in LangChain 1.0; checkpointers are the replacement P51 — Deep Agent virtual-FS state in state["files"] grows unboundedly and eventually makes checkpoint writes a latency hotspot This skill walks through picking a checkpointer by environment, enforcing threadid at the application boundary, constraining state to JSON-safe primitives, Postgres setup + migration, and time-travel for incident debugging. Pinned to langgraph >= 1.0, < 2.0, langgraph-checkpoint-postgres >= 1.0, < 2.0. Pain-catalog anchors: P16, P17, P18, P20, P22, P40, P51. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/langchain-langgraph-checkpointing

View the source on GitHub

Browse the @skills marketplace