Checkpoint and Fork
QitOS checkpoints let you save an agent’s state at any step, resume a run after interruption, and fork a run to explore alternative paths — all without rerunning from scratch. This is essential for:- Long-running tasks that may be interrupted (network errors, budget limits)
- Branching experiments where you want to explore “what if?” from a particular step
- Time-travel debugging where you restore state from an earlier checkpoint
Step 1: Basic Checkpointing
Create aCheckpointStore and configure the Engine to use it:
SqliteCheckpointStore:
Step 2: Resuming a Run
If a run is interrupted, resume from the last checkpoint:Step 3: Forking a Checkpoint
Forking creates a new branch from an existing checkpoint, allowing you to explore alternative paths without affecting the original run:Step 4: Time-Travel (Same-Thread Fork)
If you omitnew_thread_id, the fork replaces the current state within the same thread — useful for “undo and retry” scenarios:
