prompt-eng
Glossary ↗ReAct Prompting
ReAct (Reasoning + Acting) is a prompting framework, introduced in a 2022 research paper, that interleaves explicit reasoning steps with concrete actions — typically tool calls like web search, database queries, or API calls — in a repeating Thought → Action → Observation loop, allowing a model to gather new information mid-task rather than relying solely on what it already "knows" from training. In a ReAct loop, the model first writes a Thought (its reasoning about what to do next), then an Action (a specific tool call, such as search("current weather in Tokyo")), the application executes that action and returns an Observation (the tool's actual result) back into the prompt, and the model repeats — reasoning again in light of the new information — until it has enough to produce a Final Answer. This pattern is the direct conceptual ancestor of the modern "AI agent": nearly every agent framework built on function calling or tool calling (LangChain agents, Claude's tool use, OpenAI's function calling with multi-step loops) implements some variant of the ReAct loop under the hood. ReAct significantly reduces hallucination compared to a model answering from parametric memory alone, because factual claims get grounded in real tool outputs rather than the model's potentially outdated or incorrect internal knowledge, and it gives a debuggable audit trail (the Thought/Action/Observation log) showing exactly why the model reached its answer. For SaaS builders, ReAct-style loops are the backbone of any "agentic" AI feature that needs to look things up, take multi-step actions, or interact with external systems rather than just generating text from a static prompt. Concrete worked example: an AI research assistant feature answering "What's the current CEO of the company that acquired Figma's biggest competitor?" runs a ReAct loop: Thought: "I need to identify Figma's biggest competitor first." Action: search("Figma biggest competitor design tool"). Observation: "Sketch and Adobe XD are commonly cited; Adobe acquired Figma's deal fell through in 2023, but Adobe XD is a direct competitor..." Thought: "The question likely refers to a company that WAS acquired. Let me check acquisition history." Action: search("design tool acquired by company 2024"). Observation: "InVision shut down; Framer remains independent..." Thought: "I now have enough grounded information to answer accurately, citing sources rather than guessing." Final Answer: [grounded response with citations]. Without ReAct, the model would answer purely from training data, risking an outdated or fabricated answer; with it, every claim traces back to a real, timestamped tool observation.
Related terms