vibedonaldsvibedonalds.com
Term

ReAct pattern

Reasoning + Acting — a prompting pattern from a 2022 paper where the LLM interleaves chain-of-thought with explicit tool calls. The pattern that most modern coding agents implement under the hood.

Background

The ReAct pattern — short for Reasoning and Acting — structures an LLM agent so it interleaves chain-of-thought reasoning with concrete actions in a loop, rather than reasoning once and answering. On each turn the model produces a thought (its reasoning about what to do next), an action (a tool call such as a search query, an API request, or a calculation, usually emitted in a structured form), and then receives back an observation (the tool's result). That observation is appended to the context, and the model reasons again with the new information, deciding whether to act further or to give a final answer. The key idea is that reasoning guides which action to take, and the action's real-world result grounds the next round of reasoning, so the model can gather facts it does not already know instead of hallucinating them. For example, answering 'what is the population of the country where this company is headquartered' becomes: reason about what is missing, search for the headquarters, observe the country, search its population, then answer. When building software with AI, ReAct is the backbone of tool-using agents: it gives you a legible trace for debugging, lets the model recover from a failed or empty tool result, and keeps answers tied to fetched evidence. The costs are extra latency and tokens per loop, plus the need for a stop condition or step cap to prevent runaway iteration.