Skip to main content

Datstore Saver for LangGraph Checkpoints

Project description

langgraph-checkpoint-datastore

Implementation of a LangGraph CheckpointSaver that uses a GCP's Datastore

Inspiration

Based on: https://github.com/justinram11/langgraph-checkpoint-dynamodb

Required Datastore Tables

To be able to use this checkpointer, two Datastore kinds are needed, one to store checkpoints and the other to store writes.

Using the Checkpoint Saver

Default

To use the datastore checkpoint saver, you only need to specify the names of the checkpoints and writes kinds. In this scenario the datastore client will be instantiated with the default configuration, great for running on AWS Lambda.

from langgraph_checkpoint_datastore import DatastoreSaver
...
checkpoints_table_name = 'YourCheckpointsTableName'
writes_table_name = 'YourWritesTableName'

memory = DatastoreSaver(
    checkpoints_table_name=checkpoints_table_name,
    writes_table_name=writes_table_name,
)

graph = workflow.compile(checkpointer=memory)

Providing Client Configuration

If you need to provide custom configuration to the datastore client, you can pass in an object with the configuration options. Below is an example of how you can provide custom configuration.

memory = DatastoreSaver(
    checkpoints_table_name=checkpoints_table_name,
    writes_table_name=writes_table_name,
    client_config={
        'region': 'us-west-2',
    }
)

Important note, you will need to add an index to your kinds:

- kind: IntegrationCheckpoint
  properties:
  - name: thread_id
  - name: checkpoint_id
    direction: desc```

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_datastore-0.1.0.tar.gz (7.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_datastore-0.1.0.tar.gz.

File metadata

File hashes

Hashes for langgraph_checkpoint_datastore-0.1.0.tar.gz
Algorithm Hash digest
SHA256 74830ea99716f165e954208f8c2d31cf7d39c836e9adbdd64f4e21864ebd0ebe
MD5 31196fd1ee5ab4cdf03961219c489924
BLAKE2b-256 a909df3faaccf64da9a11f8e69f7a7182da9b885d791f180440cdf0f8d6021b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for langgraph_checkpoint_datastore-0.1.0.tar.gz:

Publisher: publish.yml on rynmccrmck/langgraph-checkpoint-datastore

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_datastore-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langgraph_checkpoint_datastore-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 69efaf5f7c6d98c6a2d11473c65e7cfb515c28691d582e82172f8ac7e93b782b
MD5 d77fdfbfb814ccd7d7d472e1120e7bc3
BLAKE2b-256 fb7e8f22d31c04a13df0e97d4465e212073adac1e3ae7e2ea9e5eeb94e3ffecd

See more details on using hashes here.

Provenance

The following attestation bundles were made for langgraph_checkpoint_datastore-0.1.0-py3-none-any.whl:

Publisher: publish.yml on rynmccrmck/langgraph-checkpoint-datastore

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