Agent Patterns: ReAct, Plan-and-Execute, Reflection
On this page
A team gives an agent a simple loop and a task: "Compare our three cloud bills and draft a cost memo." It searches for bills, reads the first one, searches again, re-reads the first one, wanders into public pricing pages, and after 25 steps has forgotten the third bill and written nothing. The model is capable; the loop has no structure. Agent patterns are a few proven ways to organise the steps so the agent stays on track.
How it works

ReAct: think, act, observe
The ReAct pattern (reasoning + acting) asks the model, at each step, to write a short thought (what it knows, what it needs next), then take one action (a tool call), then read the observation (the result) before the next thought. Writing the reasoning down makes the next choice better and makes the trace easy to debug. Modern models with built-in reasoning do this implicitly, but the structure still matters: one step at a time, grounded in observations.
- Good at: open-ended tasks where the next step depends on what was just found (debugging, research, support).
- Weak at: long tasks, where it can drift, repeat itself or lose sub-goals.
Plan-and-execute

A planner call writes an explicit list of steps ("1. get bill A, 2. get bill B, 3. get bill C, 4. write memo"). An executor (a cheaper model, a ReAct loop, or plain code) carries out each step, and the plan is stored as state, so nothing gets forgotten. If a step fails or reveals something new, the agent replans.
- Good at: multi-part tasks with clear sub-goals; cheaper (big model plans, small model executes); easy to show progress to users.
- Weak at: tasks where you can't know the steps in advance; a bad plan wastes every step after it.
Reflection (evaluator–optimiser)

The agent produces a draft, a critic (the same model with a different prompt, another model, or code) checks it against explicit criteria, and the feedback goes back for a revision, for at most a few rounds. Works best when the check is concrete: unit tests pass, totals add up, schema validates, every claim has a source, the rubric is met.
Other patterns worth naming
- Routing: a classifier sends each request to a specialised prompt, tool set or model.
- Orchestrator–workers: a lead agent splits a task into sub-tasks for worker agents and combines results (see Multi-Agent Systems).
- Human in the loop: pause for approval at chosen steps (see Agent Safety).
Patterns combine: a plan-and-execute agent whose executor is a ReAct loop, with a reflection pass at the end, is common.
Trade-offs and costs
| Pattern | Strength | Cost |
|---|---|---|
| ReAct | Adapts step by step | Drifts on long tasks; many calls |
| Plan-and-execute | Keeps sub-goals; cheaper executors | Bad plans; replanning logic |
| Reflection | Higher quality output | 2–3× the calls; needs a real check |
| Routing | Right tool for each request | Router mistakes |
More structure means more predictable behaviour and easier testing, but less flexibility. Start simple and add a pattern only when evals show a specific failure it fixes.
In production
- Keep the plan as visible state (a checklist in the context or a database) and update it after each step.
- Cap reflection rounds (often 1–3); quality gains flatten fast.
- Use cheaper models for execution and stronger ones for planning or critique where it pays off.
- Trace by step: plan, each action, observation and critique, so failures are attributable.
- Failure modes: plans that look sensible but skip a required step; a critic that approves everything (or rejects everything); oscillation between two drafts; replanning loops.
When to reach for it
When a plain loop fails your evals in a recognisable way: lost sub-goals → plan-and-execute; low-quality final output with a checkable standard → reflection; very different request types → routing.
Example
The cloud-bill agent was rebuilt as plan-and-execute: a planner writes the steps (one per bill plus "compare" and "write memo"); a small model executes each fetch step with a ReAct loop limited to 4 actions; a reflection step checks that all three bills appear and that totals match the sums of line items. On 40 eval tasks, completion went from 45% to 90% and average steps dropped from 22 to 9 (example numbers), because the plan stopped the repeated searching.
Common mistakes
- Adding patterns before measuring what actually fails.
- Reflection with a vague critic ("is this good?"), which mostly approves.
- Plans kept only in the model's head instead of in explicit state.
- No replanning path when a step fails.
- Using the most expensive model for every step.
Say this in the interview
"ReAct interleaves a short thought, one action and the observation, which adapts well but can drift on long tasks. Plan-and-execute writes the steps first, keeps them as state, executes them, often with cheaper models, and replans on failure. Reflection adds a critic that checks the result against concrete criteria and loops a bounded number of times. I'd start with a simple loop, measure where it fails, and add the pattern that fixes that failure."
Interview questions on this
- When is plan-and-execute better than ReAct? Multi-part tasks with clear sub-goals, where forgetting or repeating steps is the main failure.
- What makes reflection work? A concrete, checkable standard and specific feedback; a vague critic adds cost without gains.
- How do you stop endless replanning? Cap replans and steps, and escalate to a human or fail clearly.
- Why write the plan to state? So it survives long contexts and retries, and progress can be shown and checked.
- How would you cut the cost of an agent? Cheaper models for execution, fewer reflection rounds, caching tool results, and routing simple requests away from the agent.
Used in
- AI Engineering: Tool Calling and the Agent Loop; Multi-Agent Systems; Making Agents Reliable; Evaluating Agents; Your Agent Is Stuck in a Loop (practical question).
- AI System Design: Design Deep Research; Design Cursor; Design Operator.