You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ The following packages are hosted in this repository:
20
20
21
21
### LangGraph
22
22
23
-
-**Checkpointers**: Provides a custom checkpointing solution for LangGraph agents using either the [AgentCore Memory Service](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/memory.html) or the [AWS Bedrock Session Management Service](https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html).
23
+
-**Checkpointers**: Provides a custom checkpointing solution for LangGraph agents using the [AgentCore Memory Service](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/memory.html), the [AWS Bedrock Session Management Service](https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html), or the [ElastiCache Valkey Service](https://aws.amazon.com/elasticache/).
24
24
-**Memory Stores** - Provides a memory store solution for saving, processing, and retrieving intelligent long term memories using the [AgentCore Memory Service](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/memory.html).
25
25
26
26
...and more to come. This repository will continue to expand and offer additional components for various AWS services as development progresses.
A custom LangChain checkpointer implementation that uses Bedrock AgentCore Memory to enable stateful and resumable LangGraph agents through efficient state persistence and retrieval.
2
+
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.
4
3
5
4
## Overview
5
+
This package provides multiple persistence solutions for LangGraph agents:
6
6
7
-
This package provides a custom checkpointing solution for LangGraph agents using AWS Bedrock AgentCore Memory Service. It enables:
8
-
7
+
### AWS Bedrock AgentCore Memory Service
9
8
1. Stateful conversations and interactions
10
9
2. Resumable agent sessions
11
10
3. Efficient state persistence and retrieval
12
11
4. Seamless integration with AWS Bedrock
13
12
13
+
### Valkey Storage Solutions
14
+
1.**Checkpoint storage** with Valkey (Redis-compatible)
15
+
14
16
## Installation
15
17
16
18
You can install the package using pip:
17
19
18
20
```bash
21
+
# Base package (includes Bedrock AgentCore Memory components)
If you want to connect to cache from a host outside of VPC, use ElastiCache console to setup a jump host so you could create SSH tunnel to access cache locally.
457
+
458
+
#### Using Docker
459
+
```bash
460
+
# Start Valkey with required modules
461
+
docker run --name valkey-bundle -p 6379:6379 -d valkey/valkey-bundle:latest
462
+
463
+
# Or with custom configuration
464
+
docker run --name valkey-custom \
465
+
-p 6379:6379 \
466
+
-v $(pwd)/valkey.conf:/etc/valkey/valkey.conf \
467
+
-d valkey/valkey-bundle:latest
468
+
```
469
+
470
+
## Performance and Best Practices
471
+
472
+
### Valkey Performance Optimization
473
+
474
+
#### Connection Pooling
475
+
```python
476
+
# Use connection pools for better performance
477
+
from valkey.connection import ConnectionPool
478
+
479
+
pool = ConnectionPool.from_url(
480
+
"valkey://localhost:6379",
481
+
max_connections=20,
482
+
retry_on_timeout=True
483
+
)
484
+
485
+
with ValkeySaver.from_pool(pool) as checkpointer:
486
+
# Reuse connections across operations
487
+
pass
488
+
```
489
+
490
+
#### TTL Strategy
491
+
```python
492
+
# Configure appropriate TTL values
493
+
with ValkeySaver.from_conn_string(
494
+
"valkey://localhost:6379",
495
+
ttl_seconds=3600# 1 hour for active sessions
496
+
) as checkpointer:
497
+
pass
498
+
```
499
+
355
500
## Security Considerations
356
501
357
502
* Never commit AWS credentials
@@ -361,6 +506,37 @@ def __init__(
361
506
* Use IAM roles and temporary credentials when possible
362
507
* Implement proper access controls for session management
363
508
509
+
### Valkey Security
510
+
* Use SSL/TLS for production deployments (`valkeys://` protocol), refer [SSL connection examples](https://valkey-py.readthedocs.io/en/latest/examples/ssl_connection_examples.html#Connect-to-a-Valkey-instance-via-SSL,-and-validate-OCSP-stapled-certificates)
0 commit comments