What problem does it solve?
Long-running Golem agents accumulate large oplogs from heartbeats, polling loops, and frequent state changes, making recovery slow because every restart replays the full history. Snapshotting compacts the oplog so recovery starts from the latest snapshot, and it also enables manual updates between incompatible component versions.
Core Features & Use Cases
- Snapshotting Modes: Configure
snapshotting on #[agent_definition] with "every(N)" (per N invocations) or "periodic(duration)" (time-based) policies.
- Automatic Serde Snapshotting: Derive
Serialize/Deserialize on the agent struct and the SDK generates JSON-based snapshot handlers with no custom code.
- Custom Binary Snapshots: Implement
save_snapshot and load_snapshot for compact binary formats, cross-version migration, or compatibility with non-Rust components.
- Use Case: A counter agent invoked thousands of times per day enables
snapshotting = "every(1)" so recovery replays only entries after the latest snapshot instead of the entire oplog.
Quick Start
Add snapshotting to my Rust Golem agent by enabling the snapshotting attribute and deriving serde Serialize and Deserialize on the agent struct.