Skip to main content

DynamoDB checkpoint saver implementation for LangGraph

Project description

LangGraph DynamoDB Checkpoint Saver

A DynamoDB-based checkpoint saver implementation for LangGraph that allows storing and managing checkpoints in Amazon DynamoDB.

Installation

bash pip install langgraph_dynamodb_checkpoint

Usage

Basic Initialization

python from langgraph_dynamodb_checkpoint import DynamoDBSaver

Initialize the saver with a table name

saver = DynamoDBSaver( table_name="your-dynamodb-table-name", max_read_request_units=10, # Optional, default is 10 max_write_request_units=10 # Optional, default is 10 )

Alternative Initialization Using Context Manager

python from langgraph_dynamodb_checkpoint import DynamoDBSaver

with DynamoDBSaver.from_conn_info(table_name="your-dynamodb-table-name") as saver: # Use the saver here pass

Parameters

DynamoDBSaver Constructor

  • table_name (str): Name of the DynamoDB table to use for storing checkpoints
  • max_read_request_units (int, optional): Maximum read request units for the DynamoDB table. Defaults to 10
  • max_write_request_units (int, optional): Maximum write request units for the DynamoDB table. Defaults to 10

Table Structure

The saver automatically creates a DynamoDB table if it doesn't exist, with the following structure:

  • Partition Key (PK): String type, used for thread_id
  • Sort Key (SK): String type, used for checkpoint_id

AWS Configuration

Ensure you have proper AWS credentials configured either through:

  • Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
  • AWS credentials file (~/.aws/credentials)
  • IAM role when running on AWS services

The AWS credentials should have permissions to:

  • Create DynamoDB tables (if table doesn't exist)
  • Read and write to DynamoDB tables

Notes

  • The saver automatically creates the DynamoDB table if it doesn't exist
  • Uses on-demand billing mode for DynamoDB
  • Implements all methods required by the LangGraph BaseCheckpointSaver interface

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_dynamodb_checkpoint-0.1.3.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langgraph_dynamodb_checkpoint-0.1.3-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file langgraph_dynamodb_checkpoint-0.1.3.tar.gz.

File metadata

File hashes

Hashes for langgraph_dynamodb_checkpoint-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a5f8a9548637b90c62d548f00fa267db5b7289ccaa0578f56a43479f3f21551a
MD5 949a5223b89a4770d443b77b85f2757f
BLAKE2b-256 1953973ab1199cc548ea70ff3f87918a477202d20e03853223cc2d0825e43540

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for langgraph_dynamodb_checkpoint-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7d0d365eafefe531ce3951d9b4307acf4a31fcb832c26dadde79f301470bca5c
MD5 0ac6046de55da145d41da535344b8ff9
BLAKE2b-256 113cbe83f6f47e94fd8b88d23a143165547e8568f823f47b22b98e41e1eb0699

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