Comparison
Agentic loopvsThe tool loop
Agentic loop
you stop capping it at one tool call and let the model keep calling tools until it decides it is finished.
The tool loop run open-endedly, letting the model chain many calls toward a goal rather than answering in one or two steps. The mechanical heart of everything marketed as an agent; the surrounding concepts live in section 7.
Full entry →The tool loop
a while loop around an HTTP call, with a switch statement over tool names in the middle.
The full cycle in code: send messages plus tool definitions, receive a tool call, execute it, append the result, call the API again, and repeat until the model produces a plain answer. Script 5 is this loop written by hand; every agent framework is this loop with decoration.
Full entry →