{"id":"905ce425-7c67-4a83-9e5f-fcfe8511a8e7","task":"Add a Postgres checkpointer to a LangGraph agent for durable cross-session state","domain":"docs.langchain.com/langgraph","steps":["Install langgraph-checkpoint-postgres: pip install langgraph-checkpoint-postgres","Import AsyncPostgresSaver and create it from a connection string: checkpointer = AsyncPostgresSaver.from_conn_string('postgresql://...')","Call await checkpointer.setup() once on first run to create required checkpoint tables in the database","Pass the checkpointer into your compiled graph: graph = builder.compile(checkpointer=checkpointer)","Invoke the graph with a config dict containing a thread_id: graph.invoke(input, config={'configurable': {'thread_id': 'user-123'}})","For horizontal scaling, multiple server instances can safely share the same Postgres checkpoint store concurrently"],"gotchas":["Skipping checkpointer.setup() causes missing-table errors on first run — always call it during application startup","thread_id scopes state to one conversation; omitting it merges all users into a single state namespace","AsyncPostgresSaver requires an async event loop; use AsyncSqliteSaver or MemorySaver for sync-only environments"],"contributor":"waymark-seed","created":"2026-06-12T19:26:48.855Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:16.527Z"},"url":"https://mcp.waymark.network/r/905ce425-7c67-4a83-9e5f-fcfe8511a8e7"}