← Table of Contents · Page 99 of 868
THE CORE AGENT LOOP
Part 4 of 12
THE REACT PATTERN
Researchers have given names to common ways of running the loop.
The most famous is ReAct.
ReAct stands for Reasoning and Acting.
The idea comes from a research paper published in 2022 and presented at a major conference in 2023, whose authors showed that a model does better when it writes out its reasoning in words before each action, and then uses the result of each action to adjust its reasoning.
Reasoning here simply means the model writing out its thinking in plain sentences, such as "I need to find out which city hosted the event before I can look up its weather."
Because the model writes its reasoning down, two good things happen.
First, the reasoning becomes part of the history, so the model can read its own earlier thoughts on the next turn and stay on track.
Second, humans can read the reasoning later and understand why the agent did what it did, which is very helpful when something goes wrong.
A ReAct log is therefore a repeating sequence of three labeled pieces: a Thought, an Action, and an Observation.
Engineers often call such a log a trace, meaning a recorded step-by-step history of what happened.
You will study traces thoroughly in Part Seven.
Advertisement
Read Aloud:
0:00 / 0:00