The agent we built is a ReAct agent: look at the situation, pick the next tool, read the result, pick the next tool. That loop is wonderfully adaptable. A search comes back thin, it tries different terms; a tool fails, it reaches for another.
On a genuinely complex task, that same adaptability becomes a liability, and seeing why is the start of the fix.
Adaptable, and directionless
A ReAct agent decides each step from what it can see right now. That is driving without a map: at every junction you take the road that looks best from here. Close to the destination, it works. On a long, winding route, you get lost.
The lost-ness shows up as a set of familiar failures on hard tasks.
- It tries to do everything at once and loses the thread.
- It searches three times, then fails to use what it found.
- It forgets what it already did and repeats a search it already ran.
- It declares victory early, answering from partial information.
- It cannot recover from a failure. A tool errors, and instead of asking why, it repeats the same call until it hits the step limit.
Read what those share. The agent is only ever thinking about the next move. Nothing in the loop asks how to approach the whole problem, or whether things are actually going well so far.
ReAct decides one junction at a time. On a long route, that is how you get lost.
How an expert actually works
Watch a skilled researcher take a hard question. They do not start searching. They do four things a ReAct agent skips.
- Decompose. Break the question into parts. "I need this figure, then that one, then a calculation over both."
- Investigate one thing at a time, organising as they go. Find the first figure, note it, move on.
- Adjust when a result surprises them. "Two sources disagree on the distance. The question asked for the closest approach, so I will use that one."
- Check before answering. "Have I got every piece? Figure one, figure two, the calculation. Yes. Now answer."
The same pattern runs through software. Good engineers write a spec before they code, work against it, and revisit it when reality pushes back. Coding agents do this too: they draft an implementation plan, then check progress against it at each step.
Two habits sit inside that workflow. Writing the plan is planning. Checking against it is reflection.
Why time to think helps
The deeper reason this works has a name: giving the model time to think. A model asked to jump straight to an answer does worse than the same model asked to reason first, and research on language models has shown this repeatedly.
An agent inherits the effect. A ReAct agent spends all its thinking on the immediate next tool call. Planning spends some thinking up front, on direction, before any action. Reflection spends some thinking on assessment, between actions. Both trade a little more computation now for a lot less wandering later.
| Pure ReAct | With planning and reflection | |
|---|---|---|
| Horizon | The next step | The whole task |
| Direction | Whatever looks best from here | A plan, revisited |
| Failure | Repeat until the step limit | Notice, diagnose, change approach |
| Best for | Short, adaptive tasks | Long, multi-step tasks |
Planning spends thinking on direction up front; reflection spends it on assessment between steps.
The shape of the chapter
Planning and reflection are two small additions to the agent, and they are what the rest of this chapter builds.
Planning gives the agent a map before it sets off, so it stops deciding the whole route one junction at a time. Reflection gives it a moment to check the map against reality, so a wrong turn gets caught instead of driven for miles. Neither replaces the ReAct loop. Both sit on top of it, adding the two things an expert does that a reactive agent does not.
What to take from this
- A ReAct agent decides one step at a time. That makes it adaptable on short tasks and directionless on long ones, because nothing looks at the whole problem.
- Experts plan, act, and check, in that rhythm. Planning sets direction up front; reflection checks progress along the way.
- Both are forms of giving the model time to think, trading a little computation now for far less wandering later. They sit on top of the ReAct loop, not in place of it.
Planning comes first, because a plan is what reflection later checks against. The next post builds it.