BeakrGo to website
Docs/Overview/Agent engine/Checkpointing

Checkpointing & ask_user

Beakr runs two checkpointers at two different granularities. Super-step checkpoints let a mid-run graph pause for user input and resume exactly where it left off. Thread checkpoints let a whole conversation survive a provider swap or a service restart.

Why this matters

Without checkpointing, a crash means restarting the whole workflow, a user-input pause can lose context, and long tasks become fragile. With checkpointing, the agent behaves more like a stateful program than a one-shot model call: it can pause, wait, resume, and continue from a known state.

Two levels

The DB checkpointer fires after every super-step, capturing channel snapshots so the graph can pause mid-run and resume at the exact same point. The thread checkpointer fires once at run end, compressing the full conversation so the next run starts with context intact -- even across provider swaps or service restarts.

LEVEL 1 · DB CHECKPOINTERGraph-level · every super-step• saves after EVERY super-step• stores channel snapshots + versions• enables resume on ask_user block• version tracking -> exact resume point<- one checkpoint eachLEVEL 2 · THREAD CHECKPOINTERThread-level · at run end• saves at RUN END• compresses full conversation• restores messages on next run• records provider for cross-providerone per run

ask_user blocking flow

When an agent needs input, it calls ask_user with blocking mode. The graph checkpoints its state, sends a sentinel to the frontend, and stops. When the user responds, the system restores the checkpoint, replaces the sentinel with the actual answer, and resumes the graph from the same super-step -- no context lost, no re-execution.

Agent (paused)Checkpoint DBFrontend / userask_user(blocking=true)checkpoint savedASK_USER_PENDING_SENTINELuser respondsrestore channels · replace sentinel · resume