← Table of Contents · Page 106 of 868

THE CORE AGENT LOOP

Part 11 of 12

CHAPTER SUMMARY The agent loop is a repeating cycle of think, act, and observe, run by the harness around a model that only produces text. ReAct, short for Reasoning and Acting, has the model write its reasoning before each action so that the history is clear to both the model and to human readers. Plan-and-execute writes a plan first and is easy to review, while reactive looping adapts to surprises, and many harnesses blend them. Termination conditions such as success signals, harness-side checks, failures, human stops, and resource limits decide when the loop ends. Step limits, turn limits, and max iterations act like fuses, protecting you from runaway cost and time, and should end the run gracefully with partial progress reported. KEY TERMS REVIEW Agent: software that takes actions step by step toward a goal. Agent loop: the repeating think, act, observe cycle. Tool: a function the agent may call to affect the outside world. Observation: the result of an action, fed back to the model. ReAct: Reasoning and Acting, a pattern where reasoning is written out before each action. Trace: a recorded step-by-step history of a run. Plan-and-execute: write the whole plan first, then carry it out. Termination condition: a rule that ends the loop. Step limit (turn limit, max iterations): a cap on repetitions.
Advertisement
Read Aloud:
0:00 / 0:00