Skip to content
Quantoros

What is the agent loop?

LLM & AILevel: FoundationAgent Fundamentals

What is the agent loop?

Hints
  • Identify the stage: pretraining, adaptation, generation or evaluation.
  • Name the inputs, constraints and a case where the approach fails.

Answer

The agent loop is the core execution model:

  1. Perceive — receive user input or tool observations
  2. Reason — LLM decides what to do next (Thought)
  3. Act — execute the chosen action (tool call, code execution, message)
  4. Observe — receive the action's result
  5. Repeat — continue until task is complete or a stopping condition is met

Stopping conditions: task completion detected, max steps reached, user interruption, budget exceeded, unrecoverable error.

Source and licence: JustInCache & contributors — Awesome AI Interviews · Apache-2.0

Related questions