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-connector, do 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

Implementation Details: 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.

Migration Path: 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.1.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.1.tar.gz.

File metadata

File hashes

Hashes for langgraph_checkpoint_postgres_pg8000-1.0.1.tar.gz
Algorithm Hash digest
SHA256 df9b6e60f81594ffa0bbe9a999b4249e0b2ce5395b91f5e3c1f6129ebd34a6e0
MD5 7f8d0c93fcd42a8fc314fde0a912a4e4
BLAKE2b-256 8028fea5f738589e6a18b1891afa6a9ffabfd3f71c80283013855070e9cc359e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for langgraph_checkpoint_postgres_pg8000-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1b038439d91a55c38fdb08219c4ffa949a27a2ea7440d777baab00c2de0dc031
MD5 aa07db606e2373ccdff984d0fc6e679c
BLAKE2b-256 a50a9b3c230d4d632d16906e65ce480e61cc79abd5fc91fa2882192b1154e660

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