Skip to content

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_id cannot silently fork history — the losing writer writes nothing and raises ThreadConflictError.
  • Production lifecycle primitives: Thinning (keep_last=N), aprune that actually works on DeltaChannel threads, 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 with rehydrate.

Start here

Source

The source lives at davidallada/open-postgres-checkpointer.