What is the repeating loop an agent runs, and when does it stop?
LLM & AILevel: FoundationAgents & Tool Use
What is the repeating loop an agent runs, and when does it stop?
Hints
- Identify the stage: pretraining, adaptation, generation or evaluation.
- Name the inputs, constraints and a case where the approach fails.
Answer
A common tool-using agent loop is: inspect the current task and observations, choose an action, execute an authorized tool, receive its result, and update state before deciding the next step. ReAct is a particular approach that interleaves reasoning and actions; not every agent must use that exact prompting pattern.
Termination should be explicit: task completion, a final response, a tool failure requiring intervention, or a budget, time or step limit. The surrounding application should enforce those limits and permissions rather than trusting the model to stop itself. Store observations with provenance, distinguish tool output from instructions, and require appropriate approval for consequential actions.
Source and licence: Skillumen — Awesome AI Engineer Interview Questions · CC0-1.0 · answer: Quantoros editorial