AI Agents

How did AI evolve from "chatting" to "doing work"?

Agent Tool Use Planning
About 8 min read
Chapter 01

From Chat to Action

Traditional chatbots do only one thing: receive text, output text. You ask a question, it gives an answer. The conversation ends, and nothing actually gets done.

AI Agents are different. They can perceive their environment, make plans, take actions, observe results, and then repeat the cycle. They can use tools, browse the web, read and write files, call APIs — and actually get things done for you.

// COMPARE: Chatbot vs Agent

💬 Chatbot
📝 User types a message
🤖 Model generates a reply
💬 Output text, done
🧠 Agent
🤔 Think: What needs to be done?
🔧 Call a tool to execute
👀 Observe the result
🔃 Keep thinking...loop until done

A chatbot is like a customer service hotline — it can only answer questions. An agent is like a personal assistant — it can book flights, reschedule meetings, and send emails for you.

Chapter 02

The Core Loop — ReAct

ReAct (Reasoning + Acting) is the most classic operating pattern for agents. The core idea is simple: the LLM first thinks (Reasoning), then acts (Acting), then observes the result, and repeats.

The full process goes: Thought → Action → Observation → Thought → ... until the task is complete.

// INTERACTIVE DEMO: The ReAct Loop

Task: "Check tomorrow's weather in Beijing" — click "Next Step" to watch the agent's reasoning process:

Thought
I need to check the weather. I should use the weather API.
Action
call_weather_api(city="Beijing", date="tomorrow")
Observation
Sunny, 22°C, light breeze
Thought
I have the weather info now. I can answer the user.
Final Answer
Tomorrow in Beijing it will be sunny, 22°C with a light breeze — a great day to go out!
Step 1 / 5

ReAct is like solving a math problem — first think of an approach (Thought), then work it out on paper (Action), then check if it's correct (Observation).

Chapter 03

Tool Use — The Agent's "Hands"

Tool calling (Function/Tool Calling) is the key to an agent's capabilities. An LLM by itself can only generate text, but through tool calling, it can output structured JSON describing which function to call and what parameters to pass.

Important: the LLM doesn't execute tools directly — it only sends requests. An external system handles the actual execution, then returns the result to the LLM to continue reasoning.

Common Tool Types

🔍 Search 📊 Calculator 💻 Code Execution 📁 File Read/Write 🌐 API Calls 🗃 Database Queries

// INTERACTIVE DEMO: Tool Calling Flow

Click "Play" to watch how an LLM retrieves information through tool calling:

🧠
LLM Reasons
Decides it needs to
call the weather tool
📤
Outputs JSON
Structured description
of function & params
⚙️
Tool Executes
External system calls
the actual API
📥
Returns Result
Result sent back to
LLM to continue
{
  "tool": "weather_api",
  "parameters": {
    "city": "Beijing",
    "date": "2026-03-20"
  }
}
Step 1 / 4

Tools are like the agent's hands — the brain (LLM) decides what to do, and the hands (tools) carry it out.

Chapter 04

Multi-Step Planning — Breaking Down Complex Tasks

Real-world tasks often can't be completed in a single step. For example, "write me a blog post about Apple Silicon" requires the agent to break it down into multiple sub-steps and execute them in order.

The challenges include: error recovery (what if a step fails?), context management (how to filter when there's too much information?), and termination judgment (when is the task actually done?).

// INTERACTIVE DEMO: Task Decomposition

Watch how a complex task gets broken into subtasks and executed step by step:

🎯 Write a blog post about Apple Silicon
🔍 Step 1: Research latest information Pending
📝 Step 2: Draft an outline Pending
✍️ Step 3: Write the first draft Pending
Step 4: Review and revise Pending
Step 0 / 4

Multi-step planning is like cooking — you don't throw all the ingredients into the pot at once. Instead, you prep, cook, season, and plate in order.

Chapter 05

Summary

🤖

Agent = LLM + Tools + Loop

An agent doesn't just chat — it perceives, acts, and observes. At its core is an LLM-driven execution loop.

🔄

ReAct: Think, Then Act

The Thought → Action → Observation loop lets agents work like humans — thinking and doing, step by step.

🔧

Tools Expand Capabilities

Through tool calling, LLMs evolve from text-only generators into all-around assistants that can search, calculate, and execute code.

📋

Planning Conquers Complexity

Faced with multi-step tasks, agents decompose, prioritize, execute sequentially, handle errors, and keep pushing forward.

Agents are AI's evolution from "knowing the answer" to "solving the problem" — not just smarter, but genuinely useful.

Next: Reasoning Models →