Skip to content
Klay

The agent loop

After this lesson you can: Trace think → act → observe → repeat, and where to stop it.

First: Tool calling

Watch

Notes

An agent loop is a simple control loop around a language model. The model is given a goal, the current context, and usually a list of tools it can call. It decides what to do next, the system performs that action, the result is fed back as an observation, and the model decides again. The important pattern is think, act, observe, repeat.

Unlock the full lesson notes, the exercises and the graded checkpoint - ₹5,000 once.