Skip to content

feat(checkpoint-bedrock): Add bedrock checkpointer #1087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cwoolum
Copy link

@cwoolum cwoolum commented Apr 7, 2025

Overview

This PR introduces a new package @langchain/langgraph-checkpoint-bedrock that implements a CheckpointSaver for LangGraph.js using Amazon Bedrock Agent Runtime sessions for persistence. This implementation allows LangGraph applications to securely store and retrieve conversation state and context across multi-step generative AI workflows without requiring custom backend solutions.

Features

• Implements BedrockSessionSaver class that extends BaseCheckpointSaver from LangGraph
• Provides seamless integration with Amazon Bedrock Agent Runtime sessions API
• Supports storing and retrieving checkpoint data with proper serialization
• Handles pending writes and task sends for complex workflow states
• Implements checkpoint listing with filtering capabilities
• Supports session creation with optional customer-managed KMS keys for enhanced security
• Provides flexible AWS credential configuration options

Implementation Details

• Uses Amazon Bedrock Agent Runtime sessions to store LangGraph checkpoints
• Implements the full CheckpointSaver interface including put, getTuple, putWrites, and list methods
• Organizes checkpoint data using invocations and invocation steps in Bedrock sessions
• Handles serialization/deserialization of complex checkpoint data structures
• Implements proper error handling for AWS service exceptions
• Provides utility functions for AWS configuration and checkpoint management

Security Considerations

• Supports AWS IAM for access control to session data
• Implements optional customer-managed KMS key encryption
• Follows AWS best practices for credential management

Testing

• Includes unit tests for utility functions
• Provides integration tests for the full checkpoint lifecycle

Documentation

• Comprehensive README with installation and usage instructions
• Code examples for common use cases
• Detailed JSDoc comments for all public APIs

Dependencies

• Requires @aws-sdk/client-bedrock-agent-runtime as a peer dependency

@cwoolum
Copy link
Author

cwoolum commented Apr 8, 2025

@vbarda, are you taking PR's to this repo right now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant