Agentic AI & Reasoning
For the first few years of the LLM boom, AI models were treated as passive chatbots: you write a prompt, and the model instantly outputs a response. Today, the frontier has shifted toward **Agentic AI**. Instead of answering statically, agentic systems act as autonomous software entities that can plan, use external tools, inspect their own output, and run in loops to solve multi-step problems.
Tool Use & Function Calling
LLMs are notoriously bad at precise math (like multiplying two 8-digit numbers) and cannot fetch live data or interact with the physical world because they are just word-prediction engines.
**Tool Use** (or **Function Calling**) overcomes this limitation by giving models hands. The model is provided with a list of available tools, described in plain text. For example:
Available Tool: calculate_weather(location, date)
- Returns the temperature forecast for a location.
If the user asks: "Should I wear a coat in Chicago tomorrow?", the LLM recognizes it cannot answer from memory. Instead of guessing, it outputs a structured instruction:
{
"call": "calculate_weather",
"arguments": { "location": "Chicago", "date": "tomorrow" }
}
The host application intercepts this JSON, runs the actual weather API, receives the result (e.g., "Chicago: 41°F, Rain"), and appends it to the model's chat history. The LLM reads the result and finishes its response: "Yes, you should wear a coat. Chicago will be 41°F and raining tomorrow."
Reasoning Loops: ReAct and Reflection
To solve complex tasks, agents use structured loops rather than generating answers in a single pass.
1. The ReAct (Reason + Act) Loop
ReAct forces the model to document its thinking before taking actions. The loop proceeds as follows:
- Thought: The model explains its plan (e.g., "I need to find the population of France, then multiply it by 0.12").
- Action: The model calls a search engine or calculator tool.
- Observation: The model reads the tool's output and updates its plan, looping back to Thought until the task is complete.
2. Reflection and Self-Correction
If a model writes a block of code, it may contain a bug. A reflection agent doesn't send the code to the user immediately. Instead, it runs the code in an isolated environment, catches any error logs, feeds those errors back to itself, and rewrites the code to fix the bug. This cyclic feedback loop dramatically boosts task success rates.
System 1 vs. System 2 Thinking in AI
Cognitive psychologist Daniel Kahneman famously split human thinking into two modes:
- System 1 (Fast): Fast, intuitive, automatic actions (e.g., answering "2+2=?", reading a familiar road sign).
- System 2 (Slow): Slow, deliberate, logical reasoning (e.g., solving "17 × 24", filling out a tax form).
Standard LLMs operate purely in **System 1**. They output the next token immediately without pre-planning. If they start a sentence poorly, they cannot backtrack, often leading to logical dead-ends.
Modern **System 2 Reasoning Models** (like OpenAI's o1 / Strawberry series or Gemini's reasoning modes) are trained to generate a hidden "Chain of Thought" (CoT) before outputting their final response. They write thousands of invisible reasoning tokens to check their work, simulate branches of logic, backtrack when they hit errors, and deliberate on the best approach. This allows models to solve complex competition-level math, coding, and science problems.