Agent Loop
An agent loop is a repeated cycle of inference, tool execution, and feedback through which an agent works toward a goal.

Each cycle starts with an inference request. The model consumes the provided context and produces an answer or requests tool execution through tool calls.
When tools are called, the application executes them and adds their outputs to the context alongside the corresponding tool calls. This feedback becomes available to the model in the next inference request, allowing it to use the results and decide what to do next.
The cycle continues until the model produces an answer without further tool calls, or the application stops or pauses execution—for example, when a limit is reached or human input is required.