Tools Turn Guessing Into Looking
ReAct alternates thinking with tool calls so the agent gathers what it cannot guess. The action space decides how much guessing is left.
A model without tools must guess what it does not know. A model with tools can look, calculate, retrieve, run, and adapt. ReAct alternates the two in one loop: think, act, read the result, think again. The action space decides how much guessing is left.
The overview note drew the agent as five steps: observe, decide, act, examine, remember. The reasoning note bought the model room to think and left the check outside. Act is the step that reaches the check.
An Agent Interacts With an Environment
An agent acts inside an environment and reads what comes back. The environment is physical for a robot arm and digital for a browser or a terminal. It is human when the user holds context the agent has no way to fetch.
The human case carries state no tool exposes. A user who answers one question can end a search the agent cannot finish alone.
A language model agent uses text as the interface for all three. It reads observations in text, writes thoughts in text, emits actions in text, and receives the next observation in text. One channel carries the whole loop. A browser, a shell, and a person sit behind the same interface.
ReAct Alternates Reasoning With Action
The reasoning step keeps the search purposeful. The action step gathers what the model does not hold. Alternating them means each plan gets revised against something that came back from outside.
Thought: I need the current fact, not a memorized answer.
Action: search(query)
Observation: new evidence arrives
Thought: Now update the plan
Action: call_tool(args)
Observation: tool result
Final: answer with evidenceThe feedback does the work. A trace can read as coherent while the action it justifies is wrong. The observation is the only part of the turn the model did not write.
Memory Changes What the Loop Can Learn
A context window is short-term memory. It works inside one run and disappears with it. Long-term memory keeps lessons, facts, plans, failures, and skills outside the prompt, then returns them later.
Voyager stores the code skills its agent learned in Minecraft. Later runs start from earlier solutions. Generative agents let memory logs shape what the agent does next.
A chatbot is a student with a whiteboard wiped at the end of every class. An agent with memory is a student with a notebook. The notebook adds no intelligence by itself, and it changes what learning can mean.
The Action Space Decides How Much the Model Must Infer
Tool use is more than handing the model an API. The action space fixes what the model sees, what it must infer, and what a bad move costs.
A web agent that clicks one page at a time drowns in tiny observations. An interface that summarizes candidates, exposes page structure, or searches directly leaves less to infer.
Grain is a recovery decision. Small actions keep every mistake cheap and every task long. One large action finishes sooner and takes more of the run down with it. Pick the grain by what an undo costs.
The model sets the floor for a task. The interface it acts through sets the ceiling.
The Loop Needs State
Memory is what survives the run. State is what survives the step. An agent without state improvises every turn from scratch.
It can answer well in a short exchange. Long tasks break, because nothing durable holds the goals, decisions, observations, tool results, and constraints.
State does not need to be fancy. A task list, a scratchpad, or a database row counts. So does browser state, a file diff, a memory record, or an event log. The next action comes from what happened, not from what the model half remembers.
Replay a failing run step by step. Read the observation, the prompt assembly, the action proposal, the permission check, and the tool result. Then read the state update, the retry, the stop, and the report. You must explain every transition from what the logs recorded.
Blaming the model is the brittle habit. The real defect is usually an absent transition rule or stale context. A weak stop condition or an unchecked tool result does the same.
Where the Loop Breaks Today
Four weaknesses stay open, and none of them live in the prompt.
- Training: most base models never saw a long agent rollout.
- Consistency: a real task needs the same result across many runs, and one lucky pass proves nothing.
- Human collaboration: many tasks need a clarifying turn before autonomy.
- Benchmarking: single-shot accuracy misses multi-turn failure modes.
Pick the one that will bite your task first and instrument it before the next run.
The Builder Test
Trace one task turn by turn. If you cannot say what the state holds after each action, the loop is not observable enough.
- Name the transition that created the bad state.
- Separate the retry that is safe from the retry that repeats the error.
- Say whether stop meant success or only the absence of a next action.
A transition you cannot explain from evidence is where the next bad state will start.
What Carries
The loop is the unit of reliability. An agent is a repeated interaction with an environment, and every turn writes what the next turn reads. The interface decides what that record can hold.
One loop with one owner is the simple case. Add a second agent and the first question is who owns the state.