be right back · interactive explainer
Casper's agent loop, one step at a time
Casper doesn't just embed-and-return — it reasons, calls tools, reads the results, and decides whether it's done, up to 5 iterations. Step through a few real-shaped traces and watch the loop (and its anti-loop guards) do their thing.
tl;dr
Each turn is a loop: the model thinks, optionally emits a <tool_call>, Rust runs the tool and feeds
the result back as a <tool_response>, and the loop repeats until the model answers or we hit
max_iterations. Small models misbehave — they repeat the same call, narrate instead of acting, or return
empty — so the loop has guards that detect each failure and either nudge the model or force an answer.
1.Pick a scenario
0 / 0