Checkpoint-and-resume is one of five patterns for long-running AI agents named by Shubham Saboo and Addy Osmani as separating working long-running agents from demos: it treats the agent like a long-running server process, writing intermediate state to disk and checkpointing at regular intervals, so a failure partway through a long job recovers from the last checkpoint rather than starting over.

Usage

It is illustrated with an agent processing 200 documents over four hours that hits an error on document 201: without a checkpoint, that failure means starting from scratch. It is presented alongside four sibling patterns from the same write-up: delegated approval (see Human-in-the-loop), memory-layered context, ambient processing, and fleet orchestration, which are described as composable — a single system might use checkpointing for document processing and fleet orchestration to coordinate specialist agents at the same time.

When It Applies

It applies to any multi-hour or multi-day agent run where the most common failure mode is losing accumulated context to a crash or an error partway through. It assumes a persistent filesystem the agent can write to — Google’s Agent Runtime sandbox is named as one example that provides this — but choosing the right checkpoint granularity is left as a judgment call: not on every step, and not only at the very end.

Long-running Agent, Human-in-the-loop, Gemini Enterprise Agent Platform