ReAct Prompting
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
Frequently Asked Questions
From the Blog
Build a To-Do List App in React
A comprehensive guide to build a to-do list app in react — written for learners at every level.
Read More Projects & Case StudiesProject: Build a Full-Stack To-Do App with React, Node.js and MongoDB
A full-stack to-do app is the perfect first MERN project — it covers every concept you'll use in production: REST APIs, database CRUD operations, JWT authentication, and deploying a frontend and backend separately. Build it once, understand the full stack.
Read More ProgrammingReact Hooks Explained: useState, useEffect, and Beyond
React Hooks replaced class components and changed how React developers think about state and side effects. This guide explains useState, useEffect, useContext, useRef, and custom hooks clearly, with practical examples for each.
Read More Learn Through HobbiesLearn React Through Game Development: Build a Chess Clock
A chess clock is the perfect React project — it's small enough to finish in an afternoon but teaches useState, useEffect, timer management, and conditional rendering in a context that makes every concept feel purposeful. No boring counter apps.
Read More