Flashcard: what is the ReAct prompting pattern?
ReAct interleaves reasoning and tool calls in a structured Thought-Action-Observation loop, ending in a Final Answer; it is the substrate for most modern agent frameworks.
Imagine a detective solving a case out loud. They say I think the answer might be X, so let me check the records, then they actually walk to the records room and look something up, then come back and say okay, the records say Y, so now I think Z. ReAct makes the LLM behave the same way. The model writes a Thought (its reasoning), then an Action (what tool it wants to use), then the orchestrator runs the tool for real and writes back the Observation (what came back). The loop repeats until the model has enough information to write a Final Answer. The model itself cannot run tools; it just describes what tool to run, and a separate program (the orchestrator) does the actual running.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
ReAct is the prompting pattern that made agents practical. Before ReAct, LLMs were one-shot text generators: send a prompt, get an answer. After ReAct, the same model could iteratively call tools, observe results, and refine its approach across many steps. Almost every modern agent framework (LangChain, LlamaIndex, AutoGen, CrewAI, OpenAI Assistants) implements some variant of the ReAct loop under the hood.
This deep dive walks through the structure of the ReAct loop, explains exactly which side (model or orchestrator) produces which text, names the implementation mechanics that make the loop robust in production, and connects raw-text ReAct to the structured tool-calling APIs that frontier models now expose.
The structure of the loop
ReAct stands for Reason plus Act. The loop has four labels:
Thought: <the model's reasoning about what to do next>
Action: <a tool call, e.g. search('Python release date')>
Observation: <the actual result returned by the tool>
Thought: <next reasoning step that uses the observation>
Action: <next tool call, or no action if the model is ready>
Observation: <next tool result>
...
Final Answer: <the model's final response to the user>
The pattern is iterative. At each step the model produces a Thought (its reasoning) and an Action (a proposed tool call). The orchestrator runs the action against the real tool, captures the result, and writes it back as the next Observation. The model picks up reasoning from there. The loop continues until the model emits a Final Answer line, which signals it has enough information to respond.
The key insight is the separation of concerns. The model generates language; the orchestrator handles execution and state. The model cannot make a real web search or run a real SQL query; it can only describe what it wants to do. The orchestrator translates the description into an actual call, runs it, and feeds the result back into the prompt for the next iteration.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Yao et al.'s 2022 ReAct paper introduced the pattern on HotpotQA and ALFWorld benchmarks, showing it beat plain CoT and plain action-only baselines.
- LangChain's AgentExecutor and LangGraph implement ReAct as a default agent pattern, used across thousands of production LLM applications.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow does native tool-calling (Claude tool_use, OpenAI function-calling) differ from raw-text ReAct, and what does it solve?
Native tool-calling uses structured API messages with typed schemas instead of free-form text. It solves parsing reliability (no regex hacks to extract Action arguments), schema validation, and parallel tool calls. Semantics are identical to ReAct.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Thinking the LLM actually executes tools; the model only proposes actions, an orchestrator runs them and feeds the real results back as observations.
60 second bullets to scan on the way to the call.
What ReAct stands for (Reason + Act) and what each component does
The four labels in the loop (Thought, Action, Observation, Final Answer)
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.