LangGraph 1 · Memory and persistence
Persist to PostgreSQL
Use PostgreSQL for production. Install the package, then create the tables once with setup().
pip install -U langgraph-checkpoint-postgres
from langgraph.checkpoint.postgres import PostgresSaver
with PostgresSaver.from_conn_string(DB_URI) as checkpointer:
checkpointer.setup()
Official LangGraph 1 documentation
More memory and persistence commands
- Add short-term memory
- Continue a conversation on a thread
- Read the saved state
- Browse state history
- Persist to SQLite
- Add long-term memory
All memory and persistence commands · LangGraph 1 cheatsheet