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
#Initialize Redis persistence and store
REDIS_URI = "redis://localhost:6379"
with RedisSaver.from_conn_string(REDIS_URI) as checkpointer:
checkpointer.setup()
with RedisStore.from_conn_string(REDIS_URI) as store:
store.setup()
# Compile graph with both checkpointer and store
graph = builder.compile(checkpointer=checkpointer, store=store)
I want to know how to implement TTL in RedisStore.
In langgraph-redis/langgraph/store/redis/init.py in the definition of from_conn_string I can see the parameter ttl: Optional[dict[str, Any]] = None) .
I suppose I need to use that, do you have an example?
How can I set the TTL to 24hrs for the graph checkpoints I'm storing in RedisStore?
The text was updated successfully, but these errors were encountered:
Implements Time-To-Live (TTL) functionality for Redis-based checkpoint storage in LangGraph. This allows
automatic expiration of checkpoint data after a configurable time period, helping to manage Redis memory usage.
Key features:
- Add TTL configuration option to RedisSaver and AsyncRedisSaver constructors
- Implement TTL refresh-on-read functionality to extend expiration when checkpoints are accessed
- Apply TTL consistently to all related keys (checkpoints, blobs, writes)
- Add comprehensive test suite for TTL functionality
- Update type hints to use explicit format (Dict, List, Tuple) for better clarity
Implements Time-To-Live (TTL) functionality for Redis-based checkpoint storage in LangGraph. This allows
automatic expiration of checkpoint data after a configurable time period, helping to manage Redis memory usage.
Key features:
- Add TTL configuration option to RedisSaver and AsyncRedisSaver constructors
- Implement TTL refresh-on-read functionality to extend expiration when checkpoints are accessed
- Apply TTL consistently to all related keys (checkpoints, blobs, writes)
- Add comprehensive test suite for TTL functionality
- Update type hints to use explicit format (Dict, List, Tuple) for better clarity
Hello, I have a project and I am using the same configuration for Cross-thread memory shown in https://redis.io/blog/langgraph-redis-build-smarter-ai-agents-with-memory-persistence/ .
The part where they initialize the checkpointer and store is this:
I want to know how to implement TTL in RedisStore.
In langgraph-redis/langgraph/store/redis/init.py in the definition of
from_conn_string
I can see the parameterttl: Optional[dict[str, Any]] = None)
.I suppose I need to use that, do you have an example?
How can I set the TTL to 24hrs for the graph checkpoints I'm storing in RedisStore?
The text was updated successfully, but these errors were encountered: