ModelRefs / ReAct (Reason + Act) — AI Glossary

ReAct (Reason + Act) — AI Glossary

A prompting pattern interleaving model reasoning traces (Thought) with tool invocations (Action) and observations (Observation) to solve tasks.

Overview

ReAct (Yao et al. 2022) prompts the model to alternate between free-form reasoning (Thought: …), tool calls (Action: search[query]), and observation of results (Observation: …). This interleaving reduces hallucination by grounding reasoning in real tool outputs. The foundational agent loop pattern implemented by LangChain AgentExecutor and LlamaIndex ReActAgent.

Reference details

Topicagents
Also known asReAct, reason-act loop
Last reviewed2026-06-24

How it works

  1. The prompt establishes a three-label format and the model continues it, so the structure is produced by imitation of the demonstrated layout rather than by any API feature.
  2. Generation is stopped on the observation label, which is the load-bearing detail: without that stop the model continues past its own action and invents the tool result it was supposed to wait for.
  3. The harness then parses the action line, extracting a tool name and arguments from free text by pattern match — which is why malformed actions are a routine failure mode rather than an edge case.
  4. The real result is appended under the observation label and generation resumes from there, so the transcript the model sees is indistinguishable from one it wrote itself.
  5. Everything is therefore text: the format predates tool-calling APIs and was designed for models that had no structured way to express an action.
  6. Structured tool calling has since replaced the parsing while keeping the interleaving, so the pattern's durable contribution is the reasoning-between-actions sequence rather than its notation.

Example: The loop, written out

Thought: I need last quarter's revenue for Acme. Action: search_invoices(customer="Acme", quarter="Q3"). Observation: 0 results. Thought: they may bill under a parent account — let me check. Action: lookup_account("Acme"). The value is that the reasoning is written down between calls, so when the agent goes wrong you can see which Thought led it astray.

Commonly confused with

ReAct is the prompting pattern; a ReAct agent is a system built with it. The pattern is the Thought/Action/Observation interleaving — it can be implemented with plain prompting, with a tool-calling API, or inside a framework. It is not a library and not tied to one.

When to use it

Reach for it when:

  • You need the decision trace to be inspectable when something fails
  • Tool results genuinely change what the agent should do next
  • You are debugging an agent and need to see where reasoning diverged

Reach for something else when:

  • The tool sequence is fixed — the reasoning tokens buy nothing
  • You are using a model that reasons internally, where the pattern can fight the training
  • Latency matters and every step costs a full round of visible reasoning

Primary source

Referenced by

This term is used by the following ModelRefs references:

Continue your research

Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to ReAct (Reason + Act) — AI Glossary.

Frequently asked questions

What is ReAct (Reason + Act)?

A prompting pattern interleaving model reasoning traces (Thought) with tool invocations (Action) and observations (Observation) to solve tasks.

Is ReAct (Reason + Act) the same as ReAct?

Yes — ReAct, reason-act loop are common aliases for ReAct (Reason + Act).

What concepts are related to ReAct (Reason + Act)?

Closely related concepts include agent, chain of thought, tool use.