"""Production next step: the same graph on Postgres instead of SQLite. Not run in the kit's check. Follows the langgraph-checkpoint-postgres README at the pinned commit. Install first: pip install "langgraph-checkpoint-postgres==3.2.0" "psycopg[binary]" (psycopg[binary] is for machines with no system libpq; the package itself installs psycopg without extras.) Then set LANGGRAPH_POSTGRES_URI to a Postgres database you control. Keep credentials in the environment, not in this file. """ import os from langgraph.checkpoint.postgres import PostgresSaver from agent import build DB_URI = os.environ["LANGGRAPH_POSTGRES_URI"] with PostgresSaver.from_conn_string(DB_URI) as saver: saver.setup() # the README says to call .setup() the first time graph = build(saver) config = {"configurable": {"thread_id": "demo-1"}} out = graph.invoke({"message": "My invoice is wrong"}, config) print(out.get("__interrupt__", out))