Local file and in-memory checkpoints
Use FileSystemSaver when a single-host application must resume after restarting. For local development or single-process tests, use MemorySaver and reuse the same saver instance for recovery. In-memory checkpoints disappear when the process exits.
Configure a saver
New directories and new in-memory savers use the new checkpoint format by default. The local file system must support file locks, atomic replacement, and directory sync. Local processes must share the same real directory. Back up the entire directory. For multi-host deployments, use a database saver.
var saver = FileSystemSaver.builder()
.targetFolder(Path.of("/var/lib/my-app/graph"))
.build();
var blobs = saver.checkpointBlobStore("my-graph");
Register saver with the graph. For an in-memory test, use MemorySaver.builder().build(). To offload large keys, attach blobs as shown in the large state guide.
Upgrade existing files
- Back up the entire directory and reserve space for a copy of the old history. Upgrade the application using the rolling upgrade guide.
- Stop all runs and archive jobs writing to the directory. Call
activateManagedCheckpointWrites(), then restart the application or rebuild the saver and recompile the graph. - Verify recovery using the original
threadId. Existing active records are directly recoverable. To recover a specific old-vN.saverarchive, identify its thread, copy that file into an isolated directory asthread-<id>.saver, and recover from that directory.
Blob garbage collection defaults to observation only. Prune new archives according to your retention policy with pruneArchivedThreads(retention, batchSize). See retention, collection, and monitoring.