LangGraph checkpointer implementation using pg8000 for PostgreSQL. Compatible with Google Cloud SQL Connector.
Project description
LangGraph Checkpoint Postgres (pg8000)
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
[!IMPORTANT] This library is nearly 100% based on the official
langgraph-checkpoint-postgresimplementation, with adaptations forpg8000instead ofpsycopg. 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-postgreslibrary for long-term support and updates.
Related Projects
- LangGraph - Build stateful, multi-actor applications with LLMs
- langgraph-checkpoint-postgres - Official LangGraph PostgreSQL checkpointer using psycopg
- cloud-sql-python-connector - Python connector for Google Cloud SQL
- sqlmodel-gcp-postgres - SQLModel integration for Google Cloud SQL PostgreSQL
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langgraph_checkpoint_postgres_pg8000-1.0.0.tar.gz.
File metadata
- Download URL: langgraph_checkpoint_postgres_pg8000-1.0.0.tar.gz
- Upload date:
- Size: 48.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79bdf99e4b738a568e560b188da01db57d82b2b50ac08aafac50f4a177aec5de
|
|
| MD5 |
a6617efde33c6a1f6a5d1b82acd2d515
|
|
| BLAKE2b-256 |
c3940855271c0b628d546027f84bffaa924fdf8dfeab98575f35400ed5da3a25
|
File details
Details for the file langgraph_checkpoint_postgres_pg8000-1.0.0-py3-none-any.whl.
File metadata
- Download URL: langgraph_checkpoint_postgres_pg8000-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de4d874ec4a89c4461f0fee11449d280ce86f7355d473c04fa8bc9b5c0bcdbb3
|
|
| MD5 |
c1e8df097e5f71d937701653d3a755d5
|
|
| BLAKE2b-256 |
a0cf5984336e9676209ac39b3962a69c94fd8e284aa1b2657656069c0c9ea605
|