The ReAct pattern and control loop

ReAct (Reasoning + Acting) is the foundational pattern for LLM agents. The model interleaves internal reasoning (chain of thought) with external actions (tool calls). Each action produces an observation, which feeds back into the reasoning loop. This continues until the task is complete or a stopping condition is met.