Skip to main content
Version: 2.1.x

Redis single-primary checkpoints

If your application already has a Redis single primary, it can save workflow progress there. Managed checkpoints have been validated on a Redis 7.4 single primary. Managed checkpoints for Redis Cluster are deferred.

New deployments​

  • Connect with Redisson's useSingleServer(). Use the same RedissonClient for the saver, the blob store, and parent and child graphs you need to fork together. Connect application instances to the same logical database and keep the serializer and blob namespace consistent.
  • Set Redis to maxmemory-policy noeviction, permit INFO, and keep the saver's default TTL of -1. To recover progress after Redis itself restarts, enable AOF and set its sync policy to match your tolerance for data loss.
import com.alibaba.cloud.ai.graph.checkpoint.savers.redis.RedisCheckpointBlobStore;
import com.alibaba.cloud.ai.graph.checkpoint.savers.redis.RedisSaver;

var saver = RedisSaver.builder().redisson(redissonClient).build();
var blobs = new RedisCheckpointBlobStore(redissonClient, "support-workflow");

New storage uses the new checkpoint format by default. Register saver with the graph. To offload payloads, attach blobs as shown in the large state guide.

Upgrade existing checkpoints​

  1. Back up Redis and reserve space for a copy of old history. Keep the original logical database, key mappings, and serializer. Managed mode requires TTL -1.
  2. Follow the rolling upgrade guide to upgrade all instances. Drain old runs, writes, and archive jobs, then call activateManagedCheckpointWrites(). Restart the application or rebuild the saver and recompile the graph.
  3. Verify recovery with the original threadId and check the old IDs and order. Old archives whose thread mappings are missing and any custom payloads need separate migration. Rehearse with your longest thread histories. A history migration, fork, or pruning operation that would change more than 3,000 Redis keys is rejected in full.

Blob garbage collection defaults to observation only. See retention, collection, and monitoring.

Spring AI Alibaba 开源项目基于 Spring AI 构建,是阿里云通义系列模型及服务在 Java AI 应用开发领域的最佳实践,提供高层次的 AI API 抽象与云原生基础设施集成方案,帮助开发者快速构建 AI 应用。

浙ICP备2021005855号-33