Zenaique

Flashcard: what is the ReAct pattern for agents?

Flashcard·Easy·4.0 · 0·~30s·Asked atCoreweaveJpmorganKore Ai·Relevant atAnthropicLangChain
Attempt it
TL;DR

ReAct alternates Thought, Action, and Observation in a loop, so each reasoning step is conditioned on a real tool result rather than the model's own continuation.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine a chef cooking a new dish. One way is to read the whole recipe, then cook the entire meal from memory without looking again. Another way is to read one step, do it, taste the result, then decide what to do next based on what actually happened. ReAct is the second way for an LLM. The model thinks a little, takes one action like searching the web or calling a calculator, looks at the real result, and only then thinks about what to do next. The thinking and the doing take turns, and each new thought stands on something the model actually observed instead of something it guessed. That back-and-forth is what turns one model call into an agent loop.

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 pattern that turned tool-using language models into agents. Introduced by Yao et al. in 2022, it is a remarkably small idea with an outsized consequence: instead of asking the model to produce a long reasoning trace in one forward pass, you ask it to take turns between reasoning and acting, with the runtime injecting a real Observation between each pair of steps.

The one-sentence answer is that ReAct alternates Thought, Action, and Observation in a loop until the model emits a Final Answer, and the interleaving is what makes it an agent loop rather than a single forward pass. The rest of this explanation unpacks what each step contains, why the order of operations matters, and how the pattern compares to the alternatives.

The three steps and their roles

A ReAct trajectory is a strict alternation of three step types, and each one has a distinct origin.

Thought is a short natural-language reasoning step written by the model. It typically reads like an inner monologue: 'I need to find the maintainer of this library, so I should look up the repo metadata first.' Thoughts do not change the world; they make the model's plan explicit so the next Action follows from it.

Action is a structured tool call, also written by the model. In modern stacks it is emitted via provider-native function calling: a JSON object naming the tool and its arguments. The Action is what changes the state of the world or queries it.

Observation is the real result the runtime writes back into the context after executing the Action. Crucially, the Observation is not produced by the model. The runtime calls the tool, captures the response, and appends it to the conversation. That is what makes the Observation external evidence.

The loop continues with another Thought conditioned on the new Observation, then another Action, and so on, until the model decides it has enough information and emits a Final Answer instead of another Action.

text
Thought: I need the maintainer of library X.
Action: search_repo(name="X")
Observation: {"maintainer": "alice", "repo_url": "github.com/..."}
Thought: Now I should check advisories for that repo this year.
Action: fetch_advisories(repo="github.com/...", year=2026)
Observation: []
Thought: No advisories this year. I have enough to answer.
Final Answer: The maintainer is alice; no advisories filed in 2026.
Why interleaving is the whole point
What ReAct is not
Why the closed loop matters in practice
ReAct in 2026 production
ReAct as the substrate for other patterns
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • LangGraph's prebuilt ReAct agent wraps Anthropic or OpenAI function calling in a state graph where each node is one Thought, Action, Observation turn with full trace logging.
  • Claude Opus 4.7 in computer-use mode runs a ReAct-style loop: it observes a screenshot, reasons, emits a click or keystroke, then observes the next screenshot before the next Thought.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow does ReAct differ from plan-and-execute, in one sentence?
A

ReAct interleaves reasoning and acting at every step, so each Thought sees the latest Observation. Plan-and-execute writes the full plan up front and then runs the steps without re-planning, so the plan is built on the model's assumptions, not on intermediate results.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Describing ReAct as just chain-of-thought plus tools. The defining feature is the interleaving order: Observation enters the context before the next Thought.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • Name the three steps in order: Thought, Action, Observation.

  • State that the loop repeats until the model emits a Final Answer.

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
What is the Model Context Protocol (MCP) and what problem does it solve?
MCQ·Easy