Skip to main content
Version: 2.1.x

Oracle checkpoints

If your application already uses Oracle, use it to save the progress of conversations, approvals, and other workflows. Validated on Oracle Database 23ai Free 23.7.

New deployments​

  1. Initialize the new schema with the migration account and CREATE_IF_NOT_EXISTS. New checkpoint tables use the new format by default.
  2. Start the application with CREATE_NONE. To offload payloads or save deltas, build the saver and blob store with the same DataSource. Use the same DataSource for parent and child graphs you need to fork together.
import com.alibaba.cloud.ai.graph.checkpoint.savers.oracle.CreateOption;
import com.alibaba.cloud.ai.graph.checkpoint.savers.oracle.OracleCheckpointBlobStore;
import com.alibaba.cloud.ai.graph.checkpoint.savers.oracle.OracleSaver;

var saver = OracleSaver.builder()
.dataSource(dataSource)
.createOption(CreateOption.CREATE_NONE)
.build();
var blobs = new OracleCheckpointBlobStore(dataSource, "support-workflow");

Register saver with your graph. If you created blobs, follow the large state guide to select the keys to optimize.

Upgrade existing checkpoints​

  1. Back up the database and schedule a schema update window. Use the migration account to initialize the existing schema with managedCheckpoints(true) and CREATE_IF_NOT_EXISTS. The migration account needs permission to create tables, indexes, sequences, and triggers in the target schema. Check for duplicate active thread names before upgrading.
  2. Follow the rolling upgrade guide to upgrade all readers and writers. With the old application, check the progress saved by the new application during the compatibility period.
  3. Drain and isolate old writers, then call activateManagedCheckpointWrites() in the same schema. Restart the application or rebuild the saver and recompile the graph. Resume with the original threadId and serializer. Existing checkpoints can stay as they are.

Keep workflow history​

Set your policy for active history and archives first. 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