This document provides guidance for migrating between different versions of langgraph-checkpoint-redis.
This library is currently at version 0.1.0. As the library evolves, the following areas may change between versions:
- Redis key naming patterns
- JSON data structure within Redis
- Index schemas for RediSearch
- API interfaces
Important: When upgrading between major versions, checkpoint data may not be directly compatible. If you need to preserve existing checkpoint data:
- Export existing data before upgrading using the old version
- Upgrade the library to the new version
- Re-import or recreate your checkpoints using the new version
The library uses structured Redis key patterns:
Standard RedisSaver (full history):
checkpoint:{thread_id}:{checkpoint_ns}:{checkpoint_id}
checkpoint_blob:{thread_id}:{checkpoint_ns}:{channel}:{version}
checkpoint_write:{thread_id}:{checkpoint_ns}:{checkpoint_id}:{task_id}:{idx}ShallowRedisSaver (latest only):
checkpoint:{thread_id}:{checkpoint_ns} # Single checkpoint per thread/namespaceThe library now supports two checkpoint storage modes:
- ShallowRedisSaver: Stores only the most recent checkpoint per thread/namespace
- RedisSaver: Stores full checkpoint history
When migrating, consider which mode best fits your use case.
The ShallowRedisSaver now supports configurable cache sizes:
from langgraph.checkpoint.redis.shallow import ShallowRedisSaver
# Configure cache sizes
saver = ShallowRedisSaver(
redis_url="redis://localhost:6379",
key_cache_max_size=2000, # Default: 1000
channel_cache_max_size=200 # Default: 100
)TTL (Time To Live) configuration:
from langgraph.checkpoint.redis import RedisSaver
saver = RedisSaver(
redis_url="redis://localhost:6379",
ttl={
"default_ttl": 60, # Time in MINUTES (60 minutes = 1 hour)
"refresh_on_read": True # Refresh TTL when checkpoint is read
}
)Important: The default_ttl value is specified in minutes, not seconds.
LANGGRAPH_REDIS_PYPROJECT_SEARCH_DEPTH: Controls how many directory levels to search for pyproject.toml when determining version in development mode (default: 5)
- Includes RedisJSON and RediSearch modules by default
- Recommended for production use
- Requires Redis Stack or manual installation of:
- RedisJSON module
- RediSearch module
- Test in Development: Always test the migration process in a development environment first
- Backup Data: Create backups of your Redis data before migration
- Gradual Migration: If possible, run old and new versions in parallel during transition
- Monitor Performance: The new LRU cache implementation may have different performance characteristics
If you encounter issues during migration:
- Check the GitHub Issues for known problems
- Review the Release Notes for version changes
- Open a new issue with details about your migration scenario