Concepts
Loops, checkpoints and the cursor.
Loop
A loop is one run of your agent. init() creates it and returns its loopId. Every other call takes that id.
Checkpoint
A checkpoint is one step of the loop. Its type is one of:
| Type | Stores |
|---|---|
inference_request | parameters |
tool_call_request | parameters |
inference_result | result |
tool_call_result | result |
Each saved checkpoint gets an id and a createdAt timestamp (an ISO date string). You can also pass agentState, any value you want to keep with that step.
Cursor
Each loop has a cursor that points at its current checkpoint.
save()adds the checkpoint at the end of the loop and moves the cursor to it.undo()moves the cursor one checkpoint back. It fails if the cursor is already on the first checkpoint.redo()moves the cursor one checkpoint forward. It fails if the cursor is already on the last checkpoint.current()returns the checkpoint under the cursor.
Where checkpoints live
The SDK is a small client. Every call is an HTTP request to the Hronika API at HRONIKA_API, which stores the loops and checkpoints.