Reasoning + Acting. The loop that defined 2023.
A "Chain" is a straight line: A -> B -> C.
But real life is not linear.
If I ask "Who is the CEO of the company that made the iPhone?", you can't just fetch one URL.
You need to:
This requires a Loop.
ReAct stands for Reasoning + Acting. It is a prompt structure that forces the model to "Think out loud" before it touches a tool.
The Prompt Format:
Question: {input}
Thought: What do I need to do?
Action: {tool_name}
Action Input: {tool_args}
Observation: {tool_result}
... (Repeat) ...
Final Answer: {answer}
ReAct was the breakthrough that made Agents possible. It turns the "Black Box" of inference into a transparent "Step-by-Step" log.
Key Intuition: "Don't just do it. Think about it first."