> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aion.to/llms.txt
> Use this file to discover all available pages before exploring further.

# LangGraph Checkpointing

> Checkpoint behavior for LangGraph agents in the Python SDK.

## 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

```bash theme={null}
pip install langgraph-checkpoint-postgres psycopg[binary]
```

```python theme={null}
from langgraph.checkpoint.postgres import PostgresSaver

DB_URI = "postgresql://user:password@localhost:5432/dbname"
checkpointer = PostgresSaver.from_conn_string(DB_URI)
checkpointer.setup()
```

```python theme={null}
graph = builder.compile(checkpointer=checkpointer)
config = {"configurable": {"thread_id": "1"}}
graph.invoke(input_data, config)
```
