Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,62 @@ If you're using a Redis version lower than 8.0, you'll need to ensure these modu

Failure to have these modules available will result in errors during index creation and checkpoint operations.

### Azure Cache for Redis / Redis Enterprise Configuration

If you're using **Azure Cache for Redis** (especially Enterprise tier) or **Redis Enterprise**, there are important configuration considerations:

#### Client Configuration

Azure Cache for Redis and Redis Enterprise use a **proxy layer** that makes the cluster appear as a single endpoint. This requires using a **standard Redis client**, not a cluster-aware client:

```python
from redis import Redis
from langgraph.checkpoint.redis import RedisSaver

# ✅ CORRECT: Use standard Redis client for Azure/Enterprise
client = Redis(
host="your-cache.redis.cache.windows.net", # or your Redis Enterprise endpoint
port=6379, # or 10000 for Azure Enterprise with TLS
password="your-access-key",
ssl=True, # Azure/Enterprise typically requires SSL
ssl_cert_reqs="required", # or "none" for self-signed certs
decode_responses=False # RedisSaver expects bytes
)

# Pass the configured client to RedisSaver
saver = RedisSaver(redis_client=client)
saver.setup()

# ❌ WRONG: Don't use RedisCluster client with Azure/Enterprise
# from redis.cluster import RedisCluster
# cluster_client = RedisCluster(...) # This will fail with proxy-based deployments
```

#### Why This Matters

- **Proxy Architecture**: Azure Cache for Redis and Redis Enterprise use a proxy layer that handles cluster operations internally
- **Automatic Detection**: RedisSaver will correctly detect this as non-cluster mode when using the standard client
- **No Cross-Slot Errors**: The proxy handles key distribution, avoiding cross-slot errors

#### Azure Cache for Redis Specific Settings

For Azure Cache for Redis Enterprise tier:
- **Port**: Use port `10000` for Enterprise tier with TLS, or `6379` for standard
- **Modules**: Enterprise tier includes RediSearch and RedisJSON by default
- **SSL/TLS**: Always enabled, minimum TLS 1.2 for Enterprise

Example for Azure Cache for Redis Enterprise:
```python
client = Redis(
host="your-cache.redisenterprise.cache.azure.net",
port=10000, # Enterprise TLS port
password="your-access-key",
ssl=True,
ssl_cert_reqs="required",
decode_responses=False
)
```

## Installation

Install the library using pip:
Expand Down
4 changes: 3 additions & 1 deletion langgraph/checkpoint/redis/aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,9 @@ async def alist(
if isinstance(checkpoint_data, dict)
else orjson.loads(checkpoint_data)
)
channel_values = self._recursive_deserialize(checkpoint_dict.get("channel_values", {}))
channel_values = self._recursive_deserialize(
checkpoint_dict.get("channel_values", {})
)
else:
# If checkpoint data is missing, the document is corrupted
# Set empty channel values rather than attempting a fallback
Expand Down
Loading