📌 Why Agents Need to Reason
If you give an LLM access to tools, how does it know when to use them? If a user asks a complex question like, "What is the square root of the population of France?", the LLM shouldn't just guess. It needs to realize it lacks the information, search for the population, and then use a calculator.

To achieve this, developers use specific prompting frameworks that force the agent into a logical loop of reasoning.
📌 The ReAct Framework (Reason + Act)
ReAct is the most famous agent prompting framework. It forces the model to generate a "Thought" (internal monologue) before it is allowed to take an "Action" (using a tool). Once the action is complete, it receives an "Observation", which triggers the next Thought.

Example of ReAct in practice:
- Question: What is the square root of the population of France?
- Thought 1: I need to find the current population of France first.
- Action 1: [Web Search Tool: "Population of France 2024"]
- Observation 1: The population is approximately 68,000,000.
- Thought 2: Now I need to calculate the square root of 68,000,000.
- Action 2: [Calculator Tool: "sqrt(68000000)"]
- Observation 2: 8246.211
- Final Answer: The square root of the population of France is approximately 8,246.
📌 Plan-and-Solve (Advanced Planning)
While ReAct is great for step-by-step problem solving, it struggles with massive, multi-step projects because it's too near-sighted (it only thinks about the very next step). This can lead to agents getting stuck in infinite loops.
To solve this, modern agents use a Plan-and-Solve architecture.

- The Planner: A dedicated agent (or prompt) whose only job is to look at the massive goal and break it down into a strict step-by-step checklist.
- The Executor: An agent that takes the first item on the checklist, executes it (often using ReAct), checks it off, and moves to the next.
Quick Knowledge Check
Test what you just learned about Agent Reasoning
Question 1 of 1
Why might an agent developer choose to use a "Plan-and-Solve" architecture instead of standard ReAct?
Loading results...