{
  "id": 5684660,
  "title": "What an agent loop is (and isn't): state, action, stop",
  "url": "https://urgent.news/2026/09/05/what-an-agent-loop-is-and-isnt-state-action-stop",
  "topic": "ai",
  "section": "AI",
  "published": "2026-09-05T01:02:13.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/devrchancay/what-an-agent-loop-is-and-isnt-state-action-stop-560d"
  },
  "original_language": "en",
  "account": "An agent loop is a cycle that a language model goes through to accomplish a task. This cycle involves three components: state, action, and stopping condition. The model takes in text and produces text, but an agent wraps this inference in a loop. The model's output becomes a decision to run a command, read a file, or search for something. The program executes this decision and feeds the result back to the model as new context. This process repeats until a stopping condition is met, at which point the task is considered complete. Understanding these three components is essential to grasping how AI agents work.",
  "summary": "An agent loop is the cycle in which a language model decides an action, that action runs, and the result feeds back in as context for the next decision, until a stopping condition is met. That repetition—decide, act, observe, repeat—is what separates an agent from a chat. A chat answers each message once; an agent runs that cycle on its own, many times, until the task is done. This is the first…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}