What are checkpoints?
A long job runs for minutes or hours. In that time servers restart, connections drop and processes are killed. If the agent's record lives only in a running program's memory, any of those erases all of it.
A checkpoint is the fix: after each step, the harness writes the record and progress to a database. When something dies, a new process reads the last checkpoint and continues from there.
This is sometimes called durable execution. It is what lets a job outlive the machine it started on, and lets a person close their laptop and check back later.
Why do checkpoints matter?
Long jobs get interrupted. Servers restart, connections drop, limits are hit. A job that keeps its progress only in memory starts again from nothing, repeating work and, worse, repeating actions. Checkpoints let a job resume exactly where it stopped, which is what makes long-running agents practical.
How do checkpoints work?
- After each step, the job writes down where it has got to and what it has done.
- This record is kept in a store that survives a crash.
- When the job starts, it first reads the record.
- It skips everything already completed and continues from the next step.
When should you use checkpoints?
Use it when
- A job takes minutes or hours
- Steps have effects that must not be repeated
- Work is expensive to redo
Think twice when
- The whole job takes a second or two
- Starting again is harmless and cheap
Where do checkpoints sit in a real system?
Checkpoints are written by the harness to a database or file outside the running process. They hold the conversation so far and a note of completed steps.
What goes wrong with checkpoints?
- Saving only at the end, so a crash loses everything.
- Recording that a step is done before it has actually finished.
- Resuming without making repeated steps harmless.
What does checkpoints look like in practice?
An agent is emailing 200 club members when its server restarts after the fortieth. On restart it reads its record, sees that 40 are done, and continues from 41. Nobody is emailed twice.