Interleaving reasoning and acting: thought, action, observation on repeat.
Skip to solutionKEEP THE
mediumAI Engineering
What is the ReAct pattern and why did it become the default for agents?
67 views
01
Understand the problem
react-patternagentsreasoning
02
Attempt it yourself
Sketch your approach before reading the solution — that's what interviews test.
Nudge consolestandby
Stuck? Beam a request up — the console returns a conceptual nudge that guides your logic without spoiling the implementation.
03
Study the solution
ReAct (Reason + Act) has the model alternate explicit reasoning steps ('the user wants X, I should check Y') with tool actions, feeding each observation back before the next thought. The verbalized reasoning improves action selection and makes trajectories debuggable — you can see why the agent chose a tool. Modern too
Solution ready — 2 min read
Classified // press E to declassify
04
Read the code
A ReAct trajectory (what you read when debugging)
Thought: The user asks for Q2 refunds for customer 811. I need order data first.
Action: search_orders({ customer_id: "811", from_date: "2026-04-01",
to_date: "2026-06-30", status: "returned" })
Observation: 3 returned orders: #90312 ($120), #90417 ($60), #90583 ($75)
Thought: Refund totals come from the payments tool, not order totals.
Action: get_refunds({ order_ids: ["90312", "90417", "90583"] })
Observation: refunds: 90312=$120, 90417=$60, 90583=$0 (pending)
Thought: Two completed refunds ($180), one pending. I can answer precisely.
Final: "Q2 2026: $180 refunded across 2 orders; 1 refund ($75) still pending."05
Join the discussion
Discussion (0)
Sign in to join the discussion.
No responses yet. Be the first to share what you think.
Transmission complete // awaiting log
KEEP THE
STREAK ALIVE.
Dossier 56 of 80 decoded in the AI Engineering track. One more won't hurt.