Skip to content

feat(redis): add TTL support for Redis checkpoint storage (#27) #33

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

Merged
merged 1 commit into from
May 1, 2025

Conversation

bsbodden
Copy link
Contributor

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
@bsbodden bsbodden requested a review from abrookins April 30, 2025 20:06
@bsbodden bsbodden self-assigned this Apr 30, 2025
Copy link
Contributor

@abrookins abrookins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks right to me. Too bad we can't do JSON.SET ... EX. We should talk to someone about that.

@bsbodden bsbodden merged commit 6fed6ad into main May 1, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants