Open Postgres Checkpointer
A drop-in LangGraph PostgreSQL checkpointer that stores changed channel values as small zstd-prefix
patches on upstream's own tables — with lock-free connection pooling, concurrent-run fencing,
DeltaChannel pruning, thread listing, and idle-thread expiry.
Status: 1.0.0 is stable; see the Quickstart to install it.
Why switch from langgraph-checkpoint-postgres?
- 4.0×–12.5× less disk with zero graph changes: Instead of rewriting every growing channel (like
messages) in full at every step (O(N²)), values ≥ 1 KiB are stored as flat zstd-prefix patches against an earlier full copy — 6.9× smaller on a 400-step chat and 10.1× smaller on a 5,000-step thread. - No saver-wide lock: Every operation checks out its own pooled autocommit connection concurrently (1.5×–1.7× higher turns/sec at 8–32 threads; 3.9× lower tail latency when a 50 MB thread runs beside small threads).
- Optimistic concurrent-run fencing: Two overlapping runs on the same
thread_idcannot silently fork history — the losing writer writes nothing and raisesThreadConflictError. - Production lifecycle primitives: Thinning (
keep_last=N),aprunethat actually works onDeltaChannelthreads,adelete_for_runs,acopy_thread, idle-thread expiry (asweep_expired), and indexed metadata-filtered thread listing (alist_threads). - Adopt in place, roll back online: Reads every row upstream's saver wrote with no data
migration, supports zero-downtime rolling deploys (
full_copies_only=True), and rolls back to plain upstream rows in resumable batches withrehydrate.
Start here
- Why & How It Works — upstream's weaknesses, diagrams of how checkpoints grow across turns, how our solution fixes each problem, and a deep dive into the optimizations.
- Quickstart — install and basic async/sync usage.
- Adopting the saver — rolling rollout, behavioural differences, storage format, advisory locks, and supported versions.
- Rolling back — online
rehydrateand droppingopc_*tables. - Architecture — concise technical reference, Diagrams, Design notes, and Decisions.
- API Reference — auto-generated from docstrings.
Source
The source lives at davidallada/open-postgres-checkpointer.