How AI Agents Reason: ReAct, Planning, and Reflection

Turn this article into takeaways for your work.

Each assistant summarizes the article only for you and suggests best practices for your work.

An AI agent reasons by alternating between thinking and acting: it writes out a short thought about what to do next, takes an action, usually a tool call, reads what happened, and thinks again before its next move. That interleaved pattern is called ReAct, and it's the foundation most agents build on. Two techniques extend it further: planning, where the agent maps out several steps before acting on any of them, and reflection, where it critiques its own attempt and tries again when the first pass falls short.

Reasoning Is the "Reason" Step of the Loop, Made Visible

How AI agents work describes the agent loop as perceive, reason, act, observe, repeat. This article is about what happens inside that reason step, and it's less mysterious than it sounds. "Reasoning" here means the model generates intermediate text about its own next move before committing to an action, in the same conversation, where you can read it. It's not a hidden process happening somewhere else. A support agent deciding how to handle a ticket might generate something like "this message mentions a failed payment and an angry tone, so I should check the transaction history before drafting a reply" before it ever calls a tool.

That habit of writing out intermediate reasoning steps is called chain-of-thought, and it's the building block underneath everything in this article. What is chain-of-thought covers the technique on its own. What follows here is specifically about how that reasoning gets wired into a loop that also takes real actions, which is a different problem than reasoning through a static question.

ReAct: Reasoning and Acting in the Same Loop

ReAct, short for "reasoning and acting," comes from a 2022 paper by Yao and colleagues that showed language models perform better when they interleave short reasoning steps with actions, rather than reasoning all the way to a final answer and only then acting, or acting without any reasoning at all. The pattern is simple: Thought, then Action, then Observation, repeated until the task is done. The thought explains what the agent is trying to figure out next, the action is usually a tool call, and the observation is what came back.

The results from the original research were substantial. On two benchmarks testing interactive decision-making, ALFWorld and WebShop, ReAct beat imitation and reinforcement learning baselines by 34 percentage points (71% versus 37%) and roughly 11 percentage points (40% versus 29.1%), using only one or two examples to demonstrate the pattern. The reason interleaving works better than planning everything up front and then executing blindly is straightforward: the agent gets to correct course based on what actually happened, not what it assumed would happen. If a search returns nothing useful, the next thought can say so and try a different query, instead of barreling ahead on a plan built from a guess.

This is the same mechanism behind the loop described in the Autonomous Agent pattern: ingest the current state, analyze what's known and what's missing, predict the next best action, generate it, execute it, and repeat. ReAct is the reasoning half of that cycle made concrete.

Planning: Thinking Several Steps Ahead

Pure ReAct improvises one step at a time, which works well for tasks where the right next move only becomes clear after seeing the last result. Some tasks benefit from more structure than that. Planning has the agent decompose a goal into an ordered set of sub-steps before executing any of them, closer to writing an outline before drafting than making it up sentence by sentence.

A revenue forecasting task is a good example. Instead of improvising one query at a time, an agent built on the AI Forecasting Agent blueprint benefits from planning its approach first: pull historical close rates by segment, check current pipeline coverage, weight open deals by stage, then combine those into a range. Each of those sub-steps might still run its own ReAct loop internally, but the overall shape was decided up front rather than discovered step by step.

Planning isn't a one-time commitment. When a step fails or new information changes the picture, a well-built agent re-plans rather than forcing the original plan to work anyway. An extension worth knowing about is tree-of-thought reasoning, where the agent explores more than one candidate plan and compares them before committing, useful when there's genuinely more than one reasonable approach. What are reasoning models covers that territory, along with the broader shift toward models that spend more computation deliberating before they answer, in more depth.

Reflection: Catching Its Own Mistakes

Reflection adds a different capability: after producing an attempt, the agent evaluates its own output against the goal and revises when it falls short, rather than treating the first draft as final.

The research behind this, a 2023 paper on Reflexion by Shinn and colleagues, is worth knowing the actual numbers on. Their approach reached 91% pass@1 accuracy on the HumanEval coding benchmark, compared to 80% for the standard GPT-4 baseline at the time, using only a verbal self-critique loop stored in memory between attempts. No retraining, no new model weights, just the agent reading its own failed attempt, writing down what went wrong in plain language, and trying again with that note in context. That stored self-critique is a form of the working memory covered in how AI agents work; if you want the fuller picture of how agents hold onto information like this across steps and runs, AI memory is the deeper reference.

In business terms, the Content Drafting Agent blueprint uses a related idea: draft, check the draft against brand guidelines and required elements, and revise before handing it to a human for final review. The self-check doesn't replace human review. It cuts down on how many drafts arrive with an avoidable, obvious problem already in them.

Putting It Together: A Reasoning Trace Walkthrough

Here's what all three techniques look like combined, on one real task. The AI Research Agent blueprint is asked to produce a briefing on a target company ahead of a sales call.

  1. Plan. The agent breaks the goal into sub-tasks: recent funding activity, leadership changes, and any news from the last quarter.
  2. ReAct loop, sub-task one. Thought: "I need recent funding news." Action: search. Observation: three results, one from a credible source. Thought: "This looks current and relevant, I'll read it." Action: fetch the page. Observation: funding round confirmed with a date and amount.
  3. ReAct loop, sub-tasks two and three. The same thought-action-observation cycle repeats for leadership changes and recent news, each loop stopping once the agent judges it has enough signal.
  4. Reflect. Before finalizing, the agent checks its own draft against the original goal: does it cover all three sub-tasks, is anything stale or unconfirmed, is a source missing for any claim. If a gap turns up, that becomes one more targeted search rather than shipping the briefing with a hole in it.

Three techniques, one coherent output, and a trace at every step that a human could read back and understand, which matters as much as the final answer.

Why Reasoning Depth Is a Cost and Trust Tradeoff

None of this is free. Every thought the agent writes out is tokens, and every extra ReAct cycle or reflection pass adds latency on top of that. A simple lookup doesn't need multi-step planning and a self-critique pass; it needs a fast, direct answer. What are reasoning models covers the broader question of when extended, deliberate reasoning is worth the added cost and when a standard, fast response is the better call, a distinction that applies just as much to an agent's internal reasoning depth as it does to picking a model.

The other side of the tradeoff is trust, not just cost. A model can reason its way to a wrong action just as fluently and confidently as it reasons its way to a right one. Anthropic's Building Effective Agents guidance, drawn from production deployments, makes the case for keeping agentic loops as simple as the task allows rather than reaching for maximum autonomy by default, precisely because more reasoning steps mean more places for an error to enter unnoticed. That's why every reasoning trace should be logged and reviewable, not just the final action; AI agent observability covers what that logging and monitoring layer needs to include.

Key Facts

  • Reasoning in an agent means the model generates visible intermediate text about its next move before acting, most commonly through a chain-of-thought style process.
  • ReAct interleaves reasoning and action in the same loop. In the original research, this beat imitation and reinforcement learning baselines by 34 points on ALFWorld and roughly 11 points on WebShop.
  • Planning decomposes a goal into ordered sub-steps before executing, and a well-built agent re-plans when a step fails or new information changes the picture.
  • Reflection has the agent critique its own attempt and revise. The Reflexion research reached 91% pass@1 on HumanEval versus an 80% baseline using a verbal self-critique loop, with no retraining involved.
  • Deeper reasoning costs more tokens, time, and money, and doesn't reduce the risk of a confidently wrong action, which is why reasoning traces need to be logged and reviewable, not just trusted.

Frequently Asked Questions about How AI Agents Reason

What is ReAct in AI agents?

ReAct stands for reasoning and acting. It's a pattern where an AI agent interleaves short reasoning steps (thoughts) with real actions (usually tool calls) and reads the result (an observation) before its next thought, rather than reasoning all the way to a final answer before acting or acting without any reasoning at all.

What's the difference between planning and reflection in AI agents?

Planning happens before execution: the agent breaks a goal into an ordered set of sub-steps up front. Reflection happens after an attempt: the agent evaluates its own output against the goal and revises if it falls short. Many production agents use both, along with ReAct-style step-by-step reasoning within each planned sub-task.

Does adding more reasoning steps make an AI agent more accurate?

Often, but not automatically, and not for free. Research on both ReAct and reflection-based approaches shows real accuracy gains on multi-step tasks. But every added reasoning step costs tokens and time, and a longer reasoning trace can still arrive at a confidently wrong conclusion, which is why the trace needs to be logged and reviewed, not just trusted because it's longer.

Can an AI agent correct its own mistakes?

Yes, within limits. Reflection lets an agent catch and correct certain classes of mistakes, like a failed test or an incomplete draft, by critiquing its own output and trying again. It can't catch mistakes that aren't detectable from the information available to it, which is why human review still matters for consequential decisions.

How does agent reasoning relate to reasoning models like OpenAI's o1?

They're related but distinct. Reasoning models are trained to spend extra computation deliberating before responding to any single question. Agent reasoning techniques like ReAct, planning, and reflection are patterns for structuring that deliberation across a multi-step task that also involves taking real actions. An agent can be built on either a standard model or a reasoning model, and the choice depends on how complex the task's reasoning demands are.

Is chain-of-thought the same as agent reasoning?

Chain-of-thought is the underlying technique: getting a model to write out intermediate reasoning steps instead of jumping straight to an answer. Agent reasoning builds on that same habit but wires it into a loop that also takes actions and reads real results back, which is a different and more involved problem than reasoning through a single static question.

Where to Go Next

Reasoning decides what an agent does next; how AI agents use tools covers what happens once that decision turns into an action. For how a single agent's reasoning loop changes when the work is split across several agents instead, see multi-agent systems. And if you're ready to put this into an agent of your own, how to build an AI agent walks through the build process end to end, while the productivity tools roundup and how to choose an AI coding assistant guide are useful next stops if a reasoning-heavy coding agent is the kind of tool you're evaluating.

About the author

Victor Hoang

Victor Hoang

Co-Founder, Rework.com

Victor Hoang is Co-Founder and CMO of Rework. He spent 12+ years scaling B2B SaaS growth, building a lead engine that generated over 1 million leads and $10M+ in annual recurring revenue. Today he builds AI agents and MCP servers into Rework's products to empower customers across growth and operations. He writes about what actually works.