How an AI Agent Works

A simulated interactive demo

Register to try the lab

Everything below is real — it's just switched off until you register, so you can see exactly what you'd be trying first. It only takes an email and a name.

Register
How the loop works
Your request Look at everything so far Pick ONE tool call See the result All done? Final answer Yes — stop No — loop again

The demo below runs this exact loop: read_slot and write_slot are the tool calls, and each card is labeled "Loop 1," "Loop 2," or "Loop 3" to show which trip around the loop it belongs to.

The loop

One step = one round trip: the model checks the state, picks one tool call, sees the result, decides what's next. Press Next step to watch it happen.

Stateless

The model remembers nothing between calls, so the whole chat resends every step — that's the color blocks on the right; hover one for its JSON.

The slots current values

Interactive demo — try it below

max 18 steps
Your prompt
Slots A, B, C, and D each hold a number, currently in the wrong order. Compare each slot to its neighbor — A to B, B to C, C to D — and swap any pair that's backwards. Keep sweeping through until nothing's left to swap, so A ends up smallest and D largest.
Your prompt Model → tool call Tool → result Final answer

Color blocks for each step fill in here as you go.