Back to glossary

Term

ReAct (Prompting)

ReAct is a prompting pattern that has an LLM alternate between reasoning (thoughts) and action (tool calls) — the foundation behind many agent implementations.

ReAct (Prompting) — explained in more detail

ReAct stands for “Reasoning + Acting” and was described in a 2022 paper out of Google and Princeton. The model runs through a three-step loop: Thought (reflects on what to do next), Action (calls a tool, e.g. search or calculator), Observation (sees the tool’s result). These steps repeat until the Thought reads “I have enough information” and a final answer is produced. The advantage over plain chain-of-thought: the model can pull in real-world data along the way instead of relying purely on internal computation.

Example / Practical context

LangChain used ReAct as its default agent pattern for a long time; OpenAI Function Calling and Anthropic Tool Use are native API variants of the same idea — the loop no longer runs inside prompt text but via structured tool calls and tool results. In practice: a research agent thinks “I need the current weather in Berlin”, calls search_web("weather Berlin"), sees the result page, thinks “the answer is there” and formulates the final response.

Chain-of-thought lets the model think but does not call external tools — fits pure reasoning tasks. Plan-and-execute splits planning (once, upfront) and execution (linear), whereas ReAct interleaves the two. Reflexion adds a self-critique step after failed attempts. Today’s tool-capable API models implement ReAct-like loops mostly internally — the user only sees the tool calls, not the reasoning text.

Entdecke mehr

Themenuebersicht