100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
AI Fundamentals

ReAct Prompting

IntermediateTechnique6.5K learners

ReAct (Reasoning and Acting) is a prompting framework that interleaves a language model's step-by-step reasoning with concrete actions, such as tool or API calls, letting the model reason about what information it needs, take an action to…

Definition

ReAct (Reasoning and Acting) is a prompting framework that interleaves a language model's step-by-step reasoning with concrete actions, such as tool or API calls, letting the model reason about what information it needs, take an action to get it, observe the result, and continue reasoning until it can produce a final answer.

Overview

Prior to ReAct, prompting research had largely explored reasoning (chain-of-thought, generating intermediate reasoning steps toward an answer) and acting (function/tool calling, letting a model invoke external tools) as somewhat separate techniques. ReAct, introduced in a 2022 paper by Shunyu Yao and colleagues, proposed combining them into a single interleaved loop: the model generates a reasoning trace ('Thought: I need to find the current population of X'), takes an action based on that reasoning ('Action: search("current population of X")'), receives an observation from executing that action (the tool's returned result), and then continues reasoning based on the new information, repeating this Thought-Action-Observation cycle until it has gathered enough information to produce a final answer. The key insight is that reasoning and acting are mutually reinforcing: reasoning helps the model decide what action to take and how to interpret an action's result, while taking actions grounds the model's reasoning in real, verifiable information rather than relying entirely on its own possibly outdated or hallucinated internal knowledge. The paper demonstrated that this combination reduced hallucination and error propagation compared to reasoning-only approaches (which cannot verify facts against the real world) and improved interpretability compared to acting-only approaches (where it's unclear why the model chose a given action), on tasks spanning question answering, fact verification, and interactive decision-making in simulated environments. ReAct has become one of the foundational prompting patterns underlying modern LLM agents: essentially any agentic system that calls tools iteratively — a coding agent that reasons about what file to inspect next, a research agent that searches, reads, and refines its query, or a customer-support agent that looks up account details before answering — implements some variation of the ReAct Thought-Action-Observation loop, whether or not it's explicitly labeled as such. It remains a standard reference pattern taught alongside function calling and tool use when designing agentic systems, and many agent frameworks (LangChain's agent executors, for instance) originally implemented ReAct as a default reasoning strategy.

Key Concepts

  • Interleaves reasoning ('Thought') with concrete actions ('Action') and their results ('Observation')
  • Introduced in a 2022 paper by Shunyu Yao and colleagues
  • Grounds model reasoning in real, verifiable information via tool/API calls
  • Reduces hallucination compared to reasoning-only approaches with no external verification
  • Improves interpretability compared to acting-only approaches with no visible reasoning trace
  • Forms the basis of the Thought-Action-Observation loop used in many agent frameworks
  • Applicable to question answering, fact verification, and interactive decision-making tasks
  • A foundational pattern underlying most modern iterative, tool-using LLM agents

Use Cases

Building research agents that iteratively search, read, and refine queries to answer questions
Coding agents that reason about which file or command to inspect next before acting
Fact-checking or verification pipelines that ground claims in retrieved evidence
Customer-support agents that look up account or order details before responding
Interactive decision-making agents operating in simulated or real environments
General-purpose agent frameworks implementing an iterative reasoning-action loop

Frequently Asked Questions

From the Blog