Agentic loop

Also called agent loop, tool-use loop

The cycle behind an AI agent: it asks for a tool, your code runs it, the result goes back, and it decides the next step.

A model on its own can only reply. Give it tools and a loop and it can work: it asks for a search or a file, your code runs it, the result goes into the conversation, and the model reads it and decides what to do next. Each pass is a turn, and the model, not your code, chooses the next tool.

Your code's job is to run what's asked, feed back the results in order, and stop when the model says it has finished. Rules that must always hold, such as a refund limit, go in code around the loop rather than in the prompt.

For example

Asked "where's order 4471?", a support agent calls lookup_order, reads what comes back and then answers. That's 2 passes of the loop.

WITH PLUS

Put it to use

Where you'll meet agentic loop in ChatGPT, Gemini and Claude, how to use it there, and the mix-up most people make.

Daily Bytes Plus is in the Android app.