DynamoDB checkpoint saver implementation for LangGraph - Single table, auto create with delete handling
Project description
LangGraph DynamoDB Checkpoint Saver
A DynamoDB-based checkpoint saver implementation for LangGraph that allows storing and managing checkpoints in Amazon DynamoDB.
Installation
If installing this version, then delete the underlying table as well. Existing data is not compatible with version >= 1.5
bash pip install langgraph_dynamodb_checkpoint
Usage
DynamoDBSaver Constructor
table_name(str): Name of the DynamoDB table to use for storing checkpointsmax_read_request_units(int, optional): Maximum read request units for the DynamoDB table. Defaults to 10max_write_request_units(int, optional): Maximum write request units for the DynamoDB table. Defaults to 10ttl_seconds(int, optional): TTL value set for all checkpoint items.
Import
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 100
max_write_request_units=10 # Optional, default is 100
ttl_seconds=86400
)
Table has ttl enabled with attribute name set to ttl
Alternative Initialization Using Context Manager
from langgraph_dynamodb_checkpoint import DynamoDBSaver
with DynamoDBSaver.from_conn_info(table_name="your-dynamodb-table-name") as saver:
# Use the saver here
pass
Supports Delete
Checkpointer supports delete basis given thread_id
config = {"configurable": {"thread_id": "900"}}
memory.delete(config)
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
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_dynamodb_checkpoint-0.2.6.1.tar.gz.
File metadata
- Download URL: langgraph_dynamodb_checkpoint-0.2.6.1.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
801d3502e145a3113b4da142523a674eb4da842b1bab83f5153abcbfd5ea8669
|
|
| MD5 |
a833a0afcaa177b99673a5f0aa938032
|
|
| BLAKE2b-256 |
6cbee1fe9f5d56fc636c820b1a15ed351cc3c3a6d679b4fd7c3a20accab16fe5
|
File details
Details for the file langgraph_dynamodb_checkpoint-0.2.6.1-py3-none-any.whl.
File metadata
- Download URL: langgraph_dynamodb_checkpoint-0.2.6.1-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1721051efe63bd05fa42011533955d6f60b8d76375215e0e9c3945379823d6c
|
|
| MD5 |
7a0f758c8c921c0a6fa1ad90ef1cbf34
|
|
| BLAKE2b-256 |
0cdaa4d15e67392b7e3b9fb4b80683e41c6ac4df2049a19e47ef42c6b72b446f
|