Original
Chapter 6 • 9 min read • Last reviewed: June 2026

Agentic AI & Reasoning

For the first few years of the LLM boom, AI models were treated like passive chatbots: write a prompt, get an instant answer. Now the frontier has shifted toward Agentic AI. Instead of one static answer, agentic systems can plan, use tools, inspect their output, and loop through multi-step work.

Tool use and function calling

LLMs are famously bad at exact math, like multiplying two 8-digit numbers, and they cannot fetch live data or touch the physical world by themselves. They are word-prediction engines.

Tool Use (or Function Calling) overcomes this limitation by letting the host application expose specific capabilities. 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 should realize memory is not enough. Instead of guessing, it emits a structured instruction:

{
  "call": "calculate_weather",
  "arguments": { "location": "Chicago", "date": "tomorrow" }
}

The host app intercepts the JSON, calls the real weather API, gets the result, and adds it back to the chat history. The LLM reads the result and finishes: "Yes, you should wear a coat. Chicago will be 41°F and raining tomorrow."

Reasoning loops: ReAct and reflection

For complex tasks, agents use structured loops instead of one-shot answers.

1. ReAct: reason, then act

ReAct makes the model reason before taking action. The loop goes like this:

2. Reflection and self-correction

If a model writes code, the first draft may be buggy. A reflection agent does not ship it immediately. It runs the code in an isolated environment, reads errors, feeds those errors back into the model, and rewrites the code. That feedback loop boosts task success.

What Makes an Agent Safe Enough to Ship

An agent is more than a prompt with tools. The product around it needs boundaries:

The model can decide which tool to request, but the application must decide whether that request is allowed. Instructions are not access control.

System 1 vs. System 2 thinking in AI

System 1 Prompt Ans one forward pass System 2 agent loop Plan Act Observe repeat until the task is done

Cognitive psychologist Daniel Kahneman famously split human thinking into two modes:

  • System 1 (Fast): Fast, intuitive, automatic actions, like answering "2+2=?" or reading a familiar road sign.
  • System 2 (Slow): Slow, deliberate reasoning, like solving "17 x 24" or filling out a tax form.

Standard LLMs mostly act like System 1. They output the next token immediately, with limited room to plan, test, or revise. If the answer starts badly, they cannot truly rewind.

Modern System 2 Reasoning Models spend extra inference-time compute before giving the final answer. Current reasoning systems point to the same shift: models plan, use tools, check intermediate work, and keep going across longer workflows. Some expose controllable reasoning effort; others keep it internal and return a concise answer.

Sources