langchain-ai avatar

Langgraph Persistence

Memory that actually works in LangGraph applications. This covers the checkpointer system that saves graph state at every step, thread management for isolated conversations, and the Store API for cross-thread data like user preferences. Shows you how to set up PostgreSQL persistence for production, navigate checkpoint history for debugging, and handle the tricky subgraph scoping decisions that determine whether child graphs inherit persistence or run isolated. The subgraph checkpointer table alone saves hours of trial and error when building complex multi-agent workflows that need human-in-the-loop interrupts or stateful conversations.

skills.sh installs
18.8K
GitHub stars
1.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add langchain-ai/langchain-skills --skill langgraph-persistence --agent claude-code

Installs into .claude/skills of the current project.

Files

LangGraph's persistence layer enables durable execution by checkpointing graph state:
  • Checkpointer: Saves/loads graph state at every super-step
  • Thread ID: Identifies separate checkpoint sequences (conversations)
  • Store: Cross-thread memory for user preferences, facts

Two memory types:

  • Short-term (checkpointer): Thread-scoped conversation history
  • Long-term (store): Cross-thread user preferences, facts
CheckpointerUse CaseProduction Ready
InMemorySaverTesting, developmentNo
SqliteSaverLocal developmentPartial
PostgresSaverProductionYes

Checkpointer Setup

Set up a basic graph with in-memory checkpointing and thread-based state persistence.
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.graph import StateGraph, START, END
from typing_extensions import TypedDict, Annotated
import operator

class State(TypedDict):
    messages: Annotated[list, operator.add]

Sponsors

Details

Repository
github.com/langchain-ai/langchain-skills
Category
AI & Agent Building

More from langchain-ai/langchain-skills

All 15
1launchdarkly avataraiconfig-ai-metricslaunchdarkly/agent-skillsaiconfig ai metrics2Kskills.sh installs
2github avatarmicrosoft-agent-frameworkgithub/awesome-copilotCreate, update, refactor, explain, or review Microsoft Agent Framework solutions using shared guidance plus language-specific references for .NET and Python.2Kskills.sh installs
3webmaxru avatargithub-agentic-workflowswebmaxru/ai-native-devAuthors, reviews, installs, and debugs GitHub Agentic Workflows in repositories, including workflow markdown, frontmatter, gh aw compile and run flows, safe out486skills.sh installs
4elastic avatarobservability-llm-obselastic/agent-skills>0skills.sh installs
5coreyhaines31 avatarai-seocoreyhaines31/marketingskillsWhen the user wants to optimize content for AI search engines, get cited by LLMs, or appear in AI-generated answers. Also use when the user mentions 'AI SEO,' '161.6Kskills.sh installs
6vercel avatarai-sdkvercel/aiAnswer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoo69.4Kskills.sh installs