Skip to main content

Default Behavior

  • LangGraph adapter uses memory checkpointing by default.
  • If POSTGRES_URL is configured and database initialization succeeds, the adapter can use PostgreSQL-backed checkpointing.
  • During plugin initialization, checkpointer tables are set up when needed.

Operational Guidance

  • Use memory checkpointing for local development and simple test flows.
  • Use PostgreSQL checkpointing for durable state across restarts and distributed deployments.
  • Validate database connectivity before starting production workloads.

PostgreSQL Setup Example

pip install langgraph-checkpoint-postgres psycopg[binary]
from langgraph.checkpoint.postgres import PostgresSaver

DB_URI = "postgresql://user:password@localhost:5432/dbname"
checkpointer = PostgresSaver.from_conn_string(DB_URI)
checkpointer.setup()
graph = builder.compile(checkpointer=checkpointer)
config = {"configurable": {"thread_id": "1"}}
graph.invoke(input_data, config)