Every agent runs the same three-phase loop. The LLM thinks, picking the next tool to call. The runtime acts, executing the tool. The runtime observes the result and feeds it back into context. Repeat. The loop ends when the LLM emits a final answer instead of another tool call, or when a runtime guard (turn cap, cost cap, behaviour rule) stops it. The loop is what separates an agent from a single LLM call. It is also where most production bugs live: runaway loops, prompt drift, infinite re-edits, all happen inside this cycle.
1while not goal_reached:2 decision = llm.think(context, available_tools)3 if decision.is_final_answer:4 return decision.text5 result = run_tool(decision.tool, decision.args)6 context.append(result)Engineering notes from the Digitorn team. No marketing, no launch announcements, no "10 prompts that will change your life". Just the things we write that we'd want to read.