ReAct (Reasoning + Acting)

ReAct — short for Reasoning + Acting — lets an LLM do more than think: it can act. The model interleaves reasoning (thoughts about what to do) with actions (using tools like search, a calculator, or an API) and then observes the results, looping until it can answer. This combination of chain-of-thought plus tool use is the foundation of modern AI agents.

💡 In one line: ReAct interleaves reasoning with tool actions and observations in a loop, so the model can gather real information before answering.

What is ReAct?

Plain chain-of-thought reasons internally only — it can't look anything up. ReAct adds the ability to act on the world: at each step the model produces a Thought, takes an Action (calls a tool), and receives an Observation (the tool's result). It repeats this cycle until it has enough to give a final answer.

The ReAct Loop

The heart of ReAct is a loop. 

Whiteboard
Whiteboard diagram


How ReAct Differs from Chain-of-Thought

Both reason step by step — but only ReAct acts.

Why It Matters

  • Access to tools — search, databases, code, calculators, APIs.
  • Less hallucination — answers are grounded in real observations, not guessed.
  • Up-to-date & factual — it can look up current information.
  • Multi-step tasks — it can chain several actions together.
  • Self-correcting — an observation can steer the next thought.

This is exactly what turns an LLM into an agent.

Example Trace

Question: "What is the capital of the country that won the 2022 World Cup?"

Thought:      I need to find who won the 2022 World Cup.
Action:       search["2022 World Cup winner"]
Observation:  Argentina.
Thought:      Now I need Argentina's capital.
Action:       search["capital of Argentina"]
Observation:  Buenos Aires.
Thought:      I have the answer.
Answer:       Buenos Aires.

The model reasons, acts, observes, and repeats — instead of guessing from memory.

Components

  • Thought — the model's reasoning about the next step.
  • Action — the tool to use.
  • Action Input — the argument passed to the tool (e.g. a query).
  • Observation — the tool's returned result.

Benefits

  • Grounded, factual answers via real tools.
  • Dynamic — decides actions based on what it observes.
  • Handles complex, multi-step tasks.

Limitations

  • Requires tools to be set up and connected.
  • More complex than plain prompting.
  • Can loop or get stuck without good stopping rules.
  • Uses more tokens and tool calls (higher cost/latency).

Summary

  • ReAct combines reasoning with acting (tool use) in a Thought → Action → Observation loop.
  • Unlike chain-of-thought, it can look things up and act on the world.
  • This keeps answers grounded, enables multi-step tasks, and powers AI agents.
  • Its components are Thought, Action, Action Input, and Observation.
  • The trade-offs: it needs tools, adds complexity, and costs more calls. EOF echo "created"