Skip to main content

LangGraph checkpointer implementation using pg8000 for PostgreSQL. Compatible with Google Cloud SQL Connector.

Project description

LangGraph Checkpoint Postgres (pg8000)

PyPI Python Versions License: MIT

A PostgreSQL checkpointer implementation for LangGraph using the pg8000 database driver.

Why is this library needed?

The official langgraph-checkpoint-postgres library requires the psycopg database driver. However, certain deployment environments, particularly those using Google Cloud SQL for PostgreSQL with the cloud-sql-python-connectordo not currently support psycopg.

This library serves as a stopgap solution until the Google Cloud SQL Python Connector adds full psycopg support (expected early 2026). It provides the same checkpoint functionality as the official library but uses the pg8000 driver, which is supported by the Cloud SQL Connector.

Installation

# pip
pip install langgraph-checkpoint-postgres-pg8000
# uv
uv add langgraph-checkpoint-postgres-pg8000
# Poetry
poetry add langgraph-checkpoint-postgres-pg8000

Usage

Basic Setup

from langgraph_checkpoint_postgres_pg8000 import Pg8000Saver
from sqlalchemy import create_engine

# Create SQLAlchemy engine
engine = create_engine("postgresql+pg8000://user:password@host/database")

# Initialize checkpointer
checkpointer = Pg8000Saver(engine=engine)

# Use with LangGraph
graph = graph_builder.compile(checkpointer=checkpointer)

Note: Consider using sqlmodel-gcp-postgres to create an SQLAlchemy/SQLModel compatible database engine that may be used with Google Cloud SQL deployments!

Important Notes

[!IMPORTANT] This library is nearly 100% based on the official langgraph-checkpoint-postgres implementation, with adaptations for pg8000 instead of psycopg. The core logic and SQL queries remain the same.

[!NOTE] Once the Google Cloud SQL Python Connector adds full psycopg support (expected early 2026), you should migrate to the official langgraph-checkpoint-postgres library for long-term support and updates.

Related Projects

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langgraph_checkpoint_postgres_pg8000-1.0.0.tar.gz (48.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file langgraph_checkpoint_postgres_pg8000-1.0.0.tar.gz.

File metadata

File hashes

Hashes for langgraph_checkpoint_postgres_pg8000-1.0.0.tar.gz
Algorithm Hash digest
SHA256 79bdf99e4b738a568e560b188da01db57d82b2b50ac08aafac50f4a177aec5de
MD5 a6617efde33c6a1f6a5d1b82acd2d515
BLAKE2b-256 c3940855271c0b628d546027f84bffaa924fdf8dfeab98575f35400ed5da3a25

See more details on using hashes here.

File details

Details for the file langgraph_checkpoint_postgres_pg8000-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langgraph_checkpoint_postgres_pg8000-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de4d874ec4a89c4461f0fee11449d280ce86f7355d473c04fa8bc9b5c0bcdbb3
MD5 c1e8df097e5f71d937701653d3a755d5
BLAKE2b-256 a0cf5984336e9676209ac39b3962a69c94fd8e284aa1b2657656069c0c9ea605

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page