LangGraph S3 Checkpoint
A Python package that provides S3 storage capabilities for LangGraph checkpoints. This package implements the BaseCheckpointSaver interface from LangGraph to allow storing and retrieving checkpoints from Amazon S3.
Installation
You can install the package directly from PyPI:
pip install langgraph-s3-checkpointer
Or using uv:
uv pip install langgraph-s3-checkpointer
Requirements
- Python 3.8+
- boto3
- langgraph
Usage
Basic Usage
from s3checkpointer.s3saver import S3CheckpointSaver
from langgraph.graph import StateGraph
# Initialize the S3 checkpoint saver
s3_saver = S3CheckpointSaver(
bucket_name="my-langgraph-checkpoints",
prefix="my-app", # Optional prefix for S3 keys
# AWS credentials (optional if using environment variables or IAM roles)
aws_access_key_id="YOUR_ACCESS_KEY",
aws_secret_access_key="YOUR_SECRET_KEY",
region_name="us-east-1"
)
# Create a LangGraph with the S3 checkpoint saver
builder = StateGraph(checkpointer=s3_saver)
# ... define your graph nodes and edges ...
# Build the graph
graph = builder.compile()
# The graph will now use S3 for checkpoint storage
Using with Environment Variables
You can also configure AWS credentials using environment variables:
import os
from s3checkpointer.s3saver import S3CheckpointSaver
# Set AWS credentials in environment variables
os.environ["AWS_ACCESS_KEY_ID"] = "YOUR_ACCESS_KEY"
os.environ["AWS_SECRET_ACCESS_KEY"] = "YOUR_SECRET_KEY"
os.environ["AWS_REGION"] = "us-east-1"
# Initialize without explicit credentials
s3_saver = S3CheckpointSaver(
bucket_name="my-langgraph-checkpoints",
prefix="my-app"
)
Configuration Options
The S3CheckpointSaver class accepts the following parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
bucket_name |
str | Yes | The name of the S3 bucket to store checkpoints |
prefix |
str | No | A prefix to use for all keys in the bucket (default: "") |
aws_access_key_id |
str | No | AWS access key ID (default: None, read from environment) |
aws_secret_access_key |
str | No | AWS secret access key (default: None, read from environment) |
region_name |
str | No | AWS region name (default: None, read from environment) |
Features
- Store and retrieve LangGraph checkpoints in Amazon S3
- Automatic bucket creation if it doesn't exist
- Efficient batch deletion of checkpoints
- Support for checkpoint metadata
- Thread-based organization of checkpoints
Testing
To run the tests:
# Install test dependencies
pip install pytest moto
# Run tests
pytest tests/
License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Metadata
Release files for langgraph-s3-checkpointer 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langgraph_s3_checkpointer-0.1.0.tar.gz | 7.6 kB | Without provenance | Details for langgraph_s3_checkpointer-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langgraph_s3_checkpointer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for langgraph_s3_checkpointer-0.1.0-py3-none-any.whl |
Total release size: 14.0 kB
Release files / langgraph_s3_checkpointer-0.1.0.tar.gz
| Download URL | langgraph_s3_checkpointer-0.1.0.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c090ee596853724e25ce75c69b0ff4bfabd7059bcfa5b1cb9ca35ca73643a6b2
|
|
BLAKE2b-256 checksum How to use checksums |
c1e35f5835d6d39327d1e5e85efad25cd94cd4ec925c931ff690015c524525e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.4
|
Release files / langgraph_s3_checkpointer-0.1.0-py3-none-any.whl
| Download URL | langgraph_s3_checkpointer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0a7250ae296168821bd7ab84e515bfd91846ee8b830e2851284a92f6dac1886
|
|
BLAKE2b-256 checksum How to use checksums |
98dc14659fc35e2f418449443128210f47525d33c573a98045b58116a3747d31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.4
|
Security for langgraph-s3-checkpointer 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.