The Reason-Act Loop

ReAct

Part of: AI Agents & Tool Use

If you ask an agent to "find the population of the third-largest city in France," a naive setup just calls one tool and hopes. The reliable agents do something smarter: they think out loud first. "France's largest cities are Paris, Marseille, Lyon. The third is Lyon. Now I'll look up Lyon's population." Reason, then act, then read the result, then reason again. This pattern has a name: ReAct , short for Reason + Act . What it is ReAct interleaves two kinds of steps. A Thought is the model reasoning in plain language about what to do next. An Action is a tool call. After each action, the runtime returns an Observation : the tool's result, and the cycle repeats. The full trace reads as a chain: Thought, Action, Observation, Thought, Action, Observation, until the model decides it has enough and writes the final answer. The key insight is that forcing the model to reason before acting dramatically improves which tool it picks and which arguments it uses. The thought is not decoration; it is the planning that makes the next action correct. How it works One ReAct iteration looks like this: 1. Thought. The model writes a short reasoning step about the current situation and what is missin

Challenge: The ReAct Trace Walker