# LangGraph Checkpoint AWS
A custom LangChain checkpointer implementation that uses Bedrock Session Management Service to enable stateful and resumable LangGraph agents through efficient state persistence and retrieval.
## Overview
This package provides a custom checkpointing solution for LangGraph agents using AWS Bedrock Session Management Service. It enables:
1. Stateful conversations and interactions
2. Resumable agent sessions
3. Efficient state persistence and retrieval
4. Seamless integration with AWS Bedrock
## Installation
You can install the package using pip:
```bash
pip install langgraph-checkpoint-aws
```
Or with Poetry:
```bash
poetry add langgraph-checkpoint-aws
```
## Requirements
```text
Python >=3.9
langgraph-checkpoint >=2.0.0
langgraph >=0.2.55
boto3 >=1.37.3
```
## Usage
```python
from langgraph.graph import StateGraph
from langgraph_checkpoint_aws.saver import BedrockSessionSaver
# Initialize the saver
session_saver = BedrockSessionSaver(
region_name="us-west-2", # Your AWS region
credentials_profile_name="default", # Optional: AWS credentials profile
)
# Create a session
session_id = session_saver.session_client.create_session().session_id
# Use with LangGraph
builder = StateGraph(int)
builder.add_node("add_one", lambda x: x + 1)
builder.set_entry_point("add_one")
builder.set_finish_point("add_one")
graph = builder.compile(checkpointer=session_saver)
config = {"configurable": {"thread_id": session_id}}
graph.invoke(1, config)
```
## Configuration Options
`BedrockSessionSaver` accepts the following parameters:
```python
def __init__(
region_name: Optional[str] = None,
credentials_profile_name: Optional[str] = None,
aws_access_key_id: Optional[SecretStr] = None,
aws_secret_access_key: Optional[SecretStr] = None,
aws_session_token: Optional[SecretStr] = None,
endpoint_url: Optional[str] = None,
config: Optional[Config] = None,
)
```
- `region_name`: AWS region where Bedrock is available
- `credentials_profile_name`: Name of AWS credentials profile to use
- `aws_access_key_id`: AWS access key ID for authentication
- `aws_secret_access_key`: AWS secret access key for authentication
- `aws_session_token`: AWS session token for temporary credentials
- `endpoint_url`: Custom endpoint URL for the Bedrock service
- `config`: Botocore configuration object
## Development
Setting Up Development Environment
* Clone the repository:
```bash
git clone <repository-url>
cd libs/aws/langgraph-checkpoint-aws
```
* Install development dependencies:
```bash
make install_all
```
* Or install specific components:
```bash
make install_dev # Basic development tools
make install_test # Testing tools
make install_lint # Linting tools
make install_typing # Type checking tools
make install_codespell # Spell checking tools
```
## Running Tests
```bash
make tests # Run all tests
make test_watch # Run tests in watch mode
```
## Code Quality
```bash
make lint # Run linter
make format # Format code
make spell_check # Check spelling
```
## Clean Up
```bash
make clean # Remove all generated files
```
## AWS Configuration
Ensure you have AWS credentials configured using one of these methods:
1. Environment variables
2. AWS credentials file (~/.aws/credentials)
3. IAM roles
4. Direct credential injection via constructor parameters
## Required AWS permissions:
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Statement1",
"Effect": "Allow",
"Action": [
"bedrock:CreateSession",
"bedrock:GetSession",
"bedrock:UpdateSession",
"bedrock:DeleteSession",
"bedrock:EndSession",
"bedrock:ListSessions",
"bedrock:CreateInvocation",
"bedrock:ListInvocations",
"bedrock:PutInvocationStep",
"bedrock:GetInvocationStep",
"bedrock:ListInvocationSteps"
],
"Resource": [
"*"
]
},
{
"Effect": "Allow",
"Action": [
"kms:Decrypt",
"kms:Encrypt",
"kms:GenerateDataKey",
"kms:DescribeKey"
],
"Resource": "arn:aws:kms:{region}:{account}:key/{kms-key-id}"
},
{
"Effect": "Allow",
"Action": [
"bedrock:TagResource",
"bedrock:UntagResource",
"bedrock:ListTagsForResource"
],
"Resource": "arn:aws:bedrock:{region}:{account}:session/*"
}
]
}
```
## Security Considerations
* Never commit AWS credentials
* Use environment variables or AWS IAM roles for authentication
* Follow AWS security best practices
* Use IAM roles and temporary credentials when possible
* Implement proper access controls for session management
## Contributing
* Fork the repository
* Create a feature branch
* Make your changes
* Run tests and linting
* Submit a pull request
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Acknowledgments
* LangChain team for the base LangGraph framework
* AWS Bedrock team for the session management service
Raw data
{
"_id": null,
"home_page": "https://github.com/langchain-ai/langchain-aws",
"name": "langgraph-checkpoint-aws",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "aws, bedrock, langchain, langgraph, checkpointer",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/2f/e5/b9b453e7dd161ddeba93ecf0ece1b164c296458217f9a8189d49b269be5e/langgraph_checkpoint_aws-0.1.1.tar.gz",
"platform": null,
"description": "# LangGraph Checkpoint AWS\nA custom LangChain checkpointer implementation that uses Bedrock Session Management Service to enable stateful and resumable LangGraph agents through efficient state persistence and retrieval.\n\n## Overview\nThis package provides a custom checkpointing solution for LangGraph agents using AWS Bedrock Session Management Service. It enables:\n1. Stateful conversations and interactions\n2. Resumable agent sessions \n3. Efficient state persistence and retrieval \n4. Seamless integration with AWS Bedrock\n\n## Installation\nYou can install the package using pip:\n\n```bash\npip install langgraph-checkpoint-aws\n```\nOr with Poetry:\n```bash\npoetry add langgraph-checkpoint-aws\n```\n\n## Requirements\n```text\nPython >=3.9\nlanggraph-checkpoint >=2.0.0\nlanggraph >=0.2.55\nboto3 >=1.37.3\n```\n\n## Usage\n\n```python\nfrom langgraph.graph import StateGraph\nfrom langgraph_checkpoint_aws.saver import BedrockSessionSaver\n\n# Initialize the saver\nsession_saver = BedrockSessionSaver(\n region_name=\"us-west-2\", # Your AWS region\n credentials_profile_name=\"default\", # Optional: AWS credentials profile\n)\n\n# Create a session\nsession_id = session_saver.session_client.create_session().session_id\n\n# Use with LangGraph\nbuilder = StateGraph(int)\nbuilder.add_node(\"add_one\", lambda x: x + 1)\nbuilder.set_entry_point(\"add_one\")\nbuilder.set_finish_point(\"add_one\")\n\ngraph = builder.compile(checkpointer=session_saver)\nconfig = {\"configurable\": {\"thread_id\": session_id}}\ngraph.invoke(1, config)\n```\n\n## Configuration Options\n\n`BedrockSessionSaver` accepts the following parameters:\n\n```python\ndef __init__(\n region_name: Optional[str] = None,\n credentials_profile_name: Optional[str] = None,\n aws_access_key_id: Optional[SecretStr] = None,\n aws_secret_access_key: Optional[SecretStr] = None,\n aws_session_token: Optional[SecretStr] = None,\n endpoint_url: Optional[str] = None,\n config: Optional[Config] = None,\n)\n```\n\n- `region_name`: AWS region where Bedrock is available\n- `credentials_profile_name`: Name of AWS credentials profile to use\n- `aws_access_key_id`: AWS access key ID for authentication\n- `aws_secret_access_key`: AWS secret access key for authentication\n- `aws_session_token`: AWS session token for temporary credentials\n- `endpoint_url`: Custom endpoint URL for the Bedrock service\n- `config`: Botocore configuration object\n## Development\nSetting Up Development Environment\n\n* Clone the repository:\n```bash\ngit clone <repository-url>\ncd libs/aws/langgraph-checkpoint-aws\n```\n* Install development dependencies:\n```bash\nmake install_all\n```\n* Or install specific components:\n```bash\nmake install_dev # Basic development tools\nmake install_test # Testing tools\nmake install_lint # Linting tools\nmake install_typing # Type checking tools\nmake install_codespell # Spell checking tools\n```\n\n## Running Tests\n```bash\nmake tests # Run all tests\nmake test_watch # Run tests in watch mode\n\n```\n\n## Code Quality\n```bash\nmake lint # Run linter\nmake format # Format code\nmake spell_check # Check spelling\n```\n\n## Clean Up\n```bash\nmake clean # Remove all generated files\n```\n\n## AWS Configuration\n\nEnsure you have AWS credentials configured using one of these methods:\n1. Environment variables\n2. AWS credentials file (~/.aws/credentials)\n3. IAM roles\n4. Direct credential injection via constructor parameters\n\n## Required AWS permissions:\n\n```json\n{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"Statement1\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"bedrock:CreateSession\",\n \"bedrock:GetSession\",\n \"bedrock:UpdateSession\",\n \"bedrock:DeleteSession\",\n \"bedrock:EndSession\",\n \"bedrock:ListSessions\",\n \"bedrock:CreateInvocation\",\n \"bedrock:ListInvocations\",\n \"bedrock:PutInvocationStep\",\n \"bedrock:GetInvocationStep\",\n \"bedrock:ListInvocationSteps\"\n ],\n \"Resource\": [\n \"*\"\n ]\n },\n {\n \"Effect\": \"Allow\",\n \"Action\": [\n \"kms:Decrypt\",\n \"kms:Encrypt\",\n \"kms:GenerateDataKey\",\n \"kms:DescribeKey\"\n ],\n \"Resource\": \"arn:aws:kms:{region}:{account}:key/{kms-key-id}\"\n },\n {\n \"Effect\": \"Allow\",\n \"Action\": [\n \"bedrock:TagResource\",\n \"bedrock:UntagResource\",\n \"bedrock:ListTagsForResource\"\n ],\n \"Resource\": \"arn:aws:bedrock:{region}:{account}:session/*\"\n }\n ]\n}\n```\n\n## Security Considerations\n* Never commit AWS credentials\n* Use environment variables or AWS IAM roles for authentication\n* Follow AWS security best practices\n* Use IAM roles and temporary credentials when possible\n* Implement proper access controls for session management\n\n## Contributing\n* Fork the repository\n* Create a feature branch\n* Make your changes\n* Run tests and linting\n* Submit a pull request\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n* LangChain team for the base LangGraph framework\n* AWS Bedrock team for the session management service\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A LangChain checkpointer implementation that uses Bedrock Session Management Service to enable stateful and resumable LangGraph agents.",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/langchain-ai/langchain-aws",
"Repository": "https://github.com/langchain-ai/langchain-aws",
"Source Code": "https://github.com/langchain-ai/langchain-aws/tree/main/libs/langgraph-checkpoint-aws"
},
"split_keywords": [
"aws",
" bedrock",
" langchain",
" langgraph",
" checkpointer"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "2a5a918b6a94d4055ee1aae793916eb7660e8d0d582008e4301cf1819d2837b5",
"md5": "6373b1fbc62eab1d7be8658f904eec13",
"sha256": "d58bc8a763d94c6796993ebaa511643dc2f16ab43b54e2b5816d182e814237ac"
},
"downloads": -1,
"filename": "langgraph_checkpoint_aws-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6373b1fbc62eab1d7be8658f904eec13",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 16370,
"upload_time": "2025-08-12T01:54:26",
"upload_time_iso_8601": "2025-08-12T01:54:26.598295Z",
"url": "https://files.pythonhosted.org/packages/2a/5a/918b6a94d4055ee1aae793916eb7660e8d0d582008e4301cf1819d2837b5/langgraph_checkpoint_aws-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "2fe5b9b453e7dd161ddeba93ecf0ece1b164c296458217f9a8189d49b269be5e",
"md5": "0244730ef848846b0cc509b360987506",
"sha256": "4dc0e0ab7dcc899fc1df50da143ab8400ffe2a88b10c6b2058dbcfa372f2617c"
},
"downloads": -1,
"filename": "langgraph_checkpoint_aws-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "0244730ef848846b0cc509b360987506",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 15178,
"upload_time": "2025-08-12T01:54:27",
"upload_time_iso_8601": "2025-08-12T01:54:27.673630Z",
"url": "https://files.pythonhosted.org/packages/2f/e5/b9b453e7dd161ddeba93ecf0ece1b164c296458217f9a8189d49b269be5e/langgraph_checkpoint_aws-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-12 01:54:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "langchain-ai",
"github_project": "langchain-aws",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "langgraph-checkpoint-aws"
}