-
Notifications
You must be signed in to change notification settings - Fork 212
feat: Support ElastiCache Valkey LangGraph Checkpointer #697
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
Changes from 5 commits
349fe22
81cb3b7
48f30a6
6db50b2
d8d8d6c
353cfcf
aa999f0
e415c4b
4132047
4f0b0bc
17ce24e
13ee708
f00fd97
9c91d9b
f6a27d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,16 +1,18 @@ | ||||||
| # LangGraph Checkpoint AWS | ||||||
|
|
||||||
| A custom LangChain checkpointer implementation that uses Bedrock AgentCore Memory to enable stateful and resumable LangGraph agents through efficient state persistence and retrieval. | ||||||
| A custom AWS-based persistence solution for LangGraph agents that provides multiple storage backends including Bedrock AgentCore Memory and high-performance Valkey (Redis-compatible) storage. | ||||||
|
|
||||||
| ## Overview | ||||||
| This package provides multiple persistence solutions for LangGraph agents: | ||||||
|
|
||||||
| This package provides a custom checkpointing solution for LangGraph agents using AWS Bedrock AgentCore Memory Service. It enables: | ||||||
|
|
||||||
| ### AWS Bedrock AgentCore Memory Service | ||||||
| 1. Stateful conversations and interactions | ||||||
| 2. Resumable agent sessions | ||||||
| 3. Efficient state persistence and retrieval | ||||||
| 4. Seamless integration with AWS Bedrock | ||||||
|
|
||||||
| ### Valkey Storage Solutions | ||||||
| 1. **High-performance checkpoint storage** with Valkey (Redis-compatible) | ||||||
|
|
||||||
| ## Installation | ||||||
|
|
||||||
| You can install the package using pip: | ||||||
|
|
@@ -23,11 +25,25 @@ pip install langgraph-checkpoint-aws | |||||
|
|
||||||
| ```text | ||||||
| Python >=3.9 | ||||||
| langgraph-checkpoint >=2.1.0 | ||||||
| langgraph >=0.2.55 | ||||||
| boto3 >=1.39.7 | ||||||
| valkey >=6.1.1 | ||||||
| orjson >=3.9.0 | ||||||
| ``` | ||||||
seaofawareness marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| ## Usage - Checkpointer | ||||||
| ## Components | ||||||
|
|
||||||
| This package provides three main components: | ||||||
|
|
||||||
| 1. **AgentCoreMemorySaver** - AWS Bedrock-based checkpoint storage | ||||||
| 2. **ValkeyCheckpointSaver** - High-performance Valkey checkpoint storage | ||||||
| 3. **AgentCoreMemoryStore** - AWS Bedrock-based document store | ||||||
|
|
||||||
|
|
||||||
| ## Usage | ||||||
|
|
||||||
| ### 1. Bedrock Session Management | ||||||
|
|
||||||
| ```python | ||||||
| # Import LangGraph and LangChain components | ||||||
|
|
@@ -70,7 +86,7 @@ response = graph.invoke( | |||||
| ) | ||||||
| ``` | ||||||
|
|
||||||
| ## Usage - Memory Store | ||||||
| ### 2. Bedrock Memory Store | ||||||
|
|
||||||
| ```python | ||||||
| # Import LangGraph and LangChain components | ||||||
|
|
@@ -138,6 +154,93 @@ response = graph.invoke( | |||||
| ) | ||||||
| ``` | ||||||
|
|
||||||
| ### 3. Valkey Checkpoint Storage | ||||||
|
|
||||||
| High-performance checkpoint storage using Valkey (Redis-compatible): | ||||||
|
||||||
| High-performance checkpoint storage using Valkey (Redis-compatible): | |
| Checkpoint storage using Valkey (Redis-compatible): |
seaofawareness marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
seaofawareness marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
seaofawareness marked this conversation as resolved.
Show resolved
Hide resolved
seaofawareness marked this conversation as resolved.
Show resolved
Hide resolved
seaofawareness marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
seaofawareness marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #### Using AWS ElastiCache for Valkey (Recommended) | |
| #### Using AWS ElastiCache for Valkey |
seaofawareness marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
seaofawareness marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if there is any recommendation here? Is there a default we are setting in the saver class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend moving this to the usage section, and remove the security section.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """Checkpoint implementations for LangGraph checkpoint AWS.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| """Valkey checkpoint implementation for LangGraph checkpoint AWS.""" | ||
|
|
||
| from .async_saver import AsyncValkeyCheckpointSaver | ||
| from .saver import ValkeyCheckpointSaver | ||
|
|
||
| __all__ = ["ValkeyCheckpointSaver", "AsyncValkeyCheckpointSaver"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.