Skip to main content

Greenplum/MPP-optimized checkpoint saver for LangGraph (uses CTE-based list queries).

Project description

LangGraph Checkpoint Greenplum

Greenplum/MPP-optimized checkpoint savers for LangGraph. This package provides drop-in replacements for PostgresSaver and AsyncPostgresSaver that use a CTE-based list query instead of correlated subqueries, avoiding Broadcast Motion in Greenplum's MPP execution engine.

Why use this?

On Greenplum (and similar MPP databases), the default list query in langgraph-checkpoint-postgres uses correlated subqueries. The planner may broadcast the full inner tables to every segment, so list operations can be very slow on large datasets. The Greenplum savers use a CTE + JOIN pattern so the planner uses Redistribute Motion instead, often yielding orders-of-magnitude speedups for list() / alist().

Installation

Install the library and its dependency:

pip install langgraph-checkpoint-greenplum

This will pull in langgraph-checkpoint-postgres as well.

Usage

Use AsyncGreenplumSaver or GreenplumSaver exactly like the Postgres savers. Call .setup() the first time to create tables.

Async

from langgraph.checkpoint.greenplum import AsyncGreenplumSaver

DB_URI = "postgres://user:pass@host:5432/dbname"
async with AsyncGreenplumSaver.from_conn_string(DB_URI) as checkpointer:
    await checkpointer.setup()
    # use as a drop-in replacement for AsyncPostgresSaver

Sync

from langgraph.checkpoint.greenplum import GreenplumSaver

DB_URI = "postgres://user:pass@host:5432/dbname"
with GreenplumSaver.from_conn_string(DB_URI) as checkpointer:
    checkpointer.setup()
    # use as a drop-in replacement for PostgresSaver

Requirements

  • Greenplum 6+ (or PostgreSQL 9.3+) for the CTE query (uses CROSS JOIN LATERAL).
  • langgraph-checkpoint-postgres (and thus psycopg and langgraph-checkpoint) are installed automatically.

Release to PyPI (GitHub Actions)

This repository includes a publish workflow at .github/workflows/publish-pypi.yml.

One-time setup

  1. In PyPI, configure a Trusted Publisher for this project:
    • Owner: StarJourneyMingsing
    • Repository: langgraph-checkpoint-greenplum
    • Workflow name: publish-pypi.yml
    • Environment name: pypi
  2. In GitHub, create environment pypi in repository settings (optional protection rules can be added).

Publish a new version

  1. Update version in pyproject.toml.
  2. Commit and push changes.
  3. Create and push a version tag:
git tag v0.1.1
git push origin v0.1.1

The workflow will verify that tag version matches pyproject.toml, build distributions, and publish to PyPI.

License

MIT

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_greenplum-0.1.3.tar.gz (96.3 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_greenplum-0.1.3.tar.gz.

File metadata

File hashes

Hashes for langgraph_checkpoint_greenplum-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7d74a765cf8960bd69b267f330fcf23d9d91aae7bc784cc2e171e02550a82bf4
MD5 708d765d4438a91cf9c602e8e3ada9fa
BLAKE2b-256 1dbb81672f4262710b0d085c19f2579bb90ce0e5d2f1322f8bc84c8f425fd2f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for langgraph_checkpoint_greenplum-0.1.3.tar.gz:

Publisher: publish-pypi.yml on StarJourneyMingsing/langgraph-checkpoint-greenplum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langgraph_checkpoint_greenplum-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for langgraph_checkpoint_greenplum-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 44991af88886ae3238c971ad1ae26e84f8fccc928638fb646583e685b844a2d0
MD5 74c765004ba3ad2769e96f7fbbd24365
BLAKE2b-256 71064be5c5cd0bb3c9324a608604a2a0139acd451b40ec49610e75fd5ff0ed1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for langgraph_checkpoint_greenplum-0.1.3-py3-none-any.whl:

Publisher: publish-pypi.yml on StarJourneyMingsing/langgraph-checkpoint-greenplum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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