← Table of Contents · Page 97 of 868

THE CORE AGENT LOOP

Part 2 of 12

THINK, ACT, OBSERVE First, the agent thinks. In this move the harness sends the model everything it knows so far: the goal, the instructions, and the history of what has happened. The model reads all of that and decides what to do next. Second, the agent acts. An action usually means asking the harness to use a tool. A tool is a function, a small ready-made piece of software, that lets the agent do something in the outside world, such as searching the web or reading a file. You will study tools in depth in Part Four. For now, picture a tool as one button on a control panel that the agent is allowed to press. Third, the agent observes. The harness actually presses the button, collects whatever came back, and places that result in front of the model. That result is called an observation. Then the loop goes around again: the model thinks about the new observation, picks the next action, and so on. An everyday comparison helps. Imagine you are lost in a new city and trying to find a pharmacy. You look around and decide to walk toward a busy street (think). You walk (act). You notice a street sign that says Main Street (observe). With that new fact, you decide to turn left (think), you turn (act), and you see a green cross sign (observe). Nobody handed you the entire route in advance. You built it one small loop at a time, using what you saw at each step. An agent works the same way. WHO DOES WHAT INSIDE THE LOOP? It is important to see that the model and the harness split the work. The model only produces text. When the model wants to use a tool, it writes out a structured request that says which tool and which inputs. The harness is the part that reads that request, runs the tool for real, and pastes the result back in. The model never touches the outside world directly. This split is one of the most important ideas in the book, because it is the harness that can check, limit, and record every action before it happens.
Advertisement
Read Aloud:
0:00 / 0:00