ReAct Prompting

Intermediate4 min

Interleaving reasoning with action means each observation lands before the next decision, so a surprising result changes the next step instead of being absorbed into a plan nobody revisits. The pattern survived; the string parsing it was taught with did not.

#prompting
#agents

Reason, act, observe, repeat

ReAct interleaves thinking with doing. Rather than reasoning to a complete plan and then executing it, the model reasons one step, takes an action, reads the result, and reasons again with that result in hand.

The loop is four beats:

Thought:      I need the current price before I can compare.
Action:       lookup_price(sku="A-1194")
Observation:  {"price": 4500, "currency": "GBP"}
Thought:      That is above the threshold, so I should flag it.

Chain of thought covers reasoning without acting. Tools and function calling covers acting without the reasoning trace between steps. ReAct is the pattern that puts them in one loop, and it is what most agent frameworks implement underneath.

Why interleaving beats planning first

A plan made before any observation is a plan made without information.

Ask a model to plan a multi-step lookup up front and it will guess at what each step returns, then execute a sequence built on those guesses. When step two returns something unexpected, the remaining plan is already wrong and the model has no mechanism to notice.

Interleaving fixes the loop rather than the plan. Each observation lands in the context before the next decision, so a surprising result changes the next step instead of being absorbed into a plan nobody revisits.

That is also the expensive part, since every iteration resends the accumulated transcript. State and historical context covers why the tenth turn costs more than the first, and a ReAct loop is that curve by construction.

You probably do not implement the format

This is the part worth being clear about, because ReAct is often taught as a prompt template with Thought:, Action: and Observation: labels that you parse out of a text completion.

Do not build that today unless you have a reason. Native tool calling gives you the same loop with structured tool calls instead of parsed text, which removes an entire class of failure: the model writing Action: in prose, formatting arguments inconsistently, or hallucinating an observation it was supposed to wait for.

The pattern survived. The string parsing did not need to.

Where the explicit format still earns its place is with a model that has no tool calling, or a local model where you control the loop end to end and want to see every step as text.

What the loop still needs from you

Native tool calling supplies the mechanism and not the judgement. Four things stay yours.

A stopping condition. Without one the model keeps going. Multi-agent context sharing records agents that kept searching for sources which did not exist. Cap the iterations and say when to give up.

Something to check against. An agent needs a way to tell progress from motion, which agent use cases names as one of the four properties a suitable task has.

Observations the model can use. A tool returning three thousand rows fills the window with material the next step cannot read. Summarise or paginate at the tool boundary rather than hoping.

Treating observations as untrusted. Tool output is text you did not write reaching the model, which is the shape prompt injection describes.

When reasoning models change the calculation

Current models reason by default. Chain of thought covers what changed when that happened, and the effect here is that the Thought: step is no longer something you have to prompt for.

What remains valuable is the interleaving: the model gets to see each result before choosing the next action. That is a property of the loop rather than of the prompt, and it does not go away because the reasoning became implicit.

So the modern version of ReAct is a tool-calling loop with a stopping condition, and the thinking happens whether or not you ask for it.

Further reading

Knowledge check

Question 1 of 3

Why interleave reasoning with action rather than planning first?

Sign in to save your progress and pick up where you left off.