Kolkata ·  
AI engineering
agents
short · 3 min

ReAct

A 2022 prompting method where the model alternates a thought, an action and the result it reads back. The first write-up of the loop agents run on.

updated 29 Sept 2026

Before models had built-in tool calling, how did you get one to use a search engine? You asked it to write the search out as text, your code spotted it, ran it, and pasted the result back in. ReAct ("reason + act") is the 2022 paper that made that a method, and the loop it describes is the same one every agent loop runs now.

Let's watch one run. The question is a two-hop one: "Aside from the Apple Remote, what other device can control the program Apple Remote was originally designed to interact with?"

If we only let the model think it through (chain of thought), it answers from memory. The Apple Remote goes with the Apple TV, the Apple TV can be run from an iPhone, an iPad or an iPod Touch. Sounds right. It's wrong.

Now give it a small Wikipedia tool with three actions: search for a page, look up a phrase in it, and finish with an answer. And ask it to write a thought before each action:

  • Thought: find what the Apple Remote was made for. Search "Apple Remote". Back comes: it was designed to control the Front Row media center program.
  • Thought: now look up Front Row. Search "Front Row". Back comes: not found, here are some similar titles.
  • Thought: try "Front Row (software)". That page says it's controlled by an Apple Remote or the keyboard function keys.
  • Finish: keyboard function keys.

The thoughts never touch the outside world. They plan the next search, pull the useful fact out of a result, and decide what to try when a search misses. The actions are what bring back real text. You need both. Thinking alone makes facts up. Acting alone loses track of what it was looking for. In a household text game, the version with thoughts finished 71% of tasks and the same prompts with the thoughts removed finished 45%.

So is grounding in real search results a clean win? Not quite. The authors hand-labeled a sample of failed runs on multi-hop questions, and the kinds of failure moved around:

Made-up facts went away. In their place came wasted searches and reasoning that went off track, including one failure that only loops have: the model repeats its last thought and action and can't get out. That's the reason agent loops have turn limits.

The tool matters a lot here. The paper's Wikipedia tool was weak on purpose and could only find pages by exact title, which explains a good chunk of those useless searches. On multi-hop questions plain chain of thought actually scored a little higher than ReAct. The best results came from combining them: fall back to one when the other doesn't settle.

You'll rarely write a ReAct prompt today. Tool calling gives you structured actions, so nothing has to be parsed out of text. But the shape held. Let the model think before it acts and after each result, cap the steps, and put real effort into what your tools send back, since empty results are where the loop stalls.

One last thing from the paper. Because the thoughts are plain text, a person could fix a failing run by editing a couple of them mid-task, and the model carried on and succeeded. Typing a couple of hints instead of tens of actions. That only works because the reasoning is out in the open, which is a good reason to keep it in your logs too.

Further reading