AI Agents Basics
Table of Contents + β
In the last lesson, you learned AI Models vs AI Applications. Now let us understand agents, because some AI apps need multiple steps instead of one simple answer.
An agent is an AI workflow that can choose steps and use tools.
Here is a simple agent loop:
π§ What Is an AI Agent?
An AI agent is not just a chatbot response.
In simple words:
- It receives a goal.
- It decides what step may be needed.
- It may call tools.
- It reads the result.
- Then it continues or gives the final answer.
Example goal:
Find the cheapest flight for Monday morning and summarize the options.This may need more than one step.
π€ Why Agents Matter
When we ask:
Plan my meeting day.A normal chatbot may only write advice.
An agent-style app may:
- Check the calendar.
- Find free time.
- Search travel time.
- Draft a schedule.
- Ask before making changes.
So agents matter when the app needs a workflow, not only a text answer.
Goal
The user asks for a finished result, like booking options, a draft email, or a fixed bug.
Tools
The agent can call a real tool, like search for flights, read a calendar, or look up a database record.
Checks
Before sending email, deleting data, or changing an order, the app should ask the user and run normal code checks.
π Agent-Like Examples
Coding assistant
Tools like ChatGPT, Claude, Gemini, or coding assistants can act agent-like when they inspect files, read errors, run steps, and suggest the next fix.
Task planner
For a big goal, the app can first make a small plan, then run each step one by one.
Approval needed
Important actions like sending email or changing data should still ask the user first.
π Simple Agent Flow
A basic agent flow can look like this:
User goal |Model decides next step |Tool call |Tool result |Model decides again |Final answerLet us read this slowly:
- First, the user gives a goal.
- Then the model decides which tool may help.
- After that, the app calls the tool.
- Then the model reads the tool result.
- Finally, it gives the answer or chooses another step.
π§ͺ Simple Example
User asks:
Summarize my latest support ticket and suggest a reply.An agent-style app may:
- Call the support database.
- Fetch the latest ticket.
- Read the ticket text.
- Draft a reply.
- Ask the human before sending.
Notice the important part:
- The model should not directly send the reply by itself.
- The app should control permissions and final actions.
- The user should confirm important actions.
π Human Approval Checkpoints
An agent may plan steps, but every action should not be automatic.
Some actions are safe to run directly.
- Search documents.
- Read allowed ticket data.
- Draft a message.
- Suggest a next step.
Some actions should ask a human first.
- Sending an email.
- Refunding money.
- Deleting data.
- Changing account permissions.
- Posting publicly.
So a good agent workflow often looks like this:
Agent drafts action |App shows preview |Human confirms |Backend performs actionThis lets the model assist with the task, but the app still controls dangerous actions.
π§© Agent vs RAG vs Tool
These words are related, but not the same.
- RAG finds relevant information and gives it to the model.
- Tool is an external action the app can call, like database lookup or email sending.
- Agent is a workflow where the model may decide which steps or tools to use.
So an agent can use RAG.
An agent can use tools.
But RAG and tools are not automatically agents.
π§© What Youβve Learned
- β An agent is an AI workflow that can choose steps and use tools.
- β Agents fit tasks that need multiple steps, like search, compare, decide, and then write the answer.
- β Agents still need normal code, permissions, logs, and human approval for important actions.
Check Your Knowledge
Test what you learned. Pick an answer for each question, then click Check.
- 1
What is an AI agent in simple words?
Why: An agent is a workflow where the model may plan steps and use tools.
- 2
When is an agent more useful?
Why: Agent-style workflows help when a task needs planning, tool use, or repeated steps.
- 3
What should happen before an agent sends an important email?
Why: Important actions should be controlled by the app and confirmed by the user.
- 4
Is every chatbot an agent?
Why: A simple chatbot may only answer one prompt and may not plan steps or use tools.
π Whatβs Next?
When agents use tools, every app should not need a different custom connection style. For example, an AI coding app and a chat app may both need access to files or APIs. Next, let us understand MCP.