freecoding.school100% FREE · NO SIGNUP
Tensor TownISSUE #66 of 120

react · reason + act loops

NeuraVSThe Overfit Ogre
Neura saysReAct interleaves reasoning and actions — think, act (use a tool), observe, repeat.

The ReAct pattern lets a model alternate between reasoning ("I should look up X") and acting (calling a tool, searching, running code), then observing the result and continuing. This grounds reasoning in real data and tool outputs instead of pure recall, reducing hallucination. It's the conceptual backbone of tool-using agents — reason about what to do, do it, learn from the result, loop.

Power-ups you unlock

The Overfit Ogre attacks — common mistakes

Boss battleTrace a ReAct loop for "what’s the weather in the user’s city?".

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>think: need the city → act: get_location()
observe: "NYC" → act: get_weather("NYC")
observe: 21°C → answer</pre></body></html>
▶ Open the interactive comic issue
‹ Tree Of Thoughts · Branching ReasoningSelf-Consistency · Sample And Vote ›