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.2.tar.gz (95.8 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.2.tar.gz.

File metadata

File hashes

Hashes for langgraph_checkpoint_greenplum-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3ed8c672dee9e15f5d1b928ac07c8687a38546aae66902ea89ec3fa93c9eddda
MD5 2565d5b6fb9042eed2b543a603de6ee5
BLAKE2b-256 7580d5930bc53a3e8160bdad3022611c7b4c2d4da4acde859da9de2ce6d32d5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for langgraph_checkpoint_greenplum-0.1.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for langgraph_checkpoint_greenplum-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4de296c9fc8babd551ec4cb4fbd8a370bc8035b7e651584e3907cc856b5aad47
MD5 1eb18e9afabdfe5418de12f52e260538
BLAKE2b-256 38923d8a7cc846bb3563707fcead915c32793b8e7c43d998d99fed36e9475daa

See more details on using hashes here.

Provenance

The following attestation bundles were made for langgraph_checkpoint_greenplum-0.1.2-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