What Are AI Agents? Agentic AI Explained
What an AI agent is, how agentic AI differs from a chatbot or a fixed workflow, and when an agent is (and is not) the right tool.
What is an AI agent?
An AI agent is a program where a large language model (LLM) decides what to do next in a loop. Instead of answering once and stopping, the model can call tools — search the web, query a database, run code, send an email — read the results, and keep going until the task is done.
A useful one-line definition:
An AI agent is an LLM that uses tools in a loop to reach a goal.
That's the whole idea behind agentic AI. Everything else — memory, planning, multi-agent systems — is built on top of that loop.
Chatbot vs workflow vs agent
Students often mix these up. The difference is who decides the steps.
| Chatbot | Workflow | AI agent | |
|---|---|---|---|
| Steps | One request → one answer | Fixed sequence written by a developer | Chosen by the model at runtime |
| Uses tools? | No | Yes, in a fixed order | Yes, in whatever order the task needs |
| Example | "Explain recursion" | "Summarise every new support ticket" | "Find why yesterday's deploy broke and open a fix PR" |
| Predictability | High | High | Lower — the path changes per task |
A workflow is code you control: step 1, then step 2, then step 3. An agent is given a goal and a toolbox and works out the path itself.
The agent loop
Every agent, from a weekend project to a production coding agent, runs the same loop:
1. Send the goal + available tools to the model
2. Model replies with either:
a) a final answer → stop
b) one or more tool calls
3. Your code runs the tools and sends the results back
4. Go to step 2
The model never runs tools itself. It asks for a tool call in a structured format; your application executes it and returns the result. That separation is what keeps agents controllable — you decide which tools exist and what each one is allowed to do.
What agents are good at
Agents shine when a task is multi-step and hard to script in advance:
- Coding agents — read files, run tests, edit code, repeat until tests pass.
- Research agents — search several sources, read them, and write a summary with citations.
- Data agents — explore a database, write SQL, check the numbers, build a report.
- Customer support agents — look up an order, check the refund policy, and draft a reply.
- DevOps agents — read logs, find the failing service, suggest or apply a fix.
When NOT to build an agent
Agents cost more (several model calls per task), are slower, and are less predictable than plain code. Before you build one, ask four questions:
- Is it really multi-step? Extracting a title from a PDF is one call, not an agent.
- Is it worth the cost? The result should justify extra latency and tokens.
- Can the model actually do it? Test the hardest step by hand first.
- Can mistakes be caught? Tests, reviews, approvals or easy rollback make agents safe to run.
If any answer is "no", use a single LLM call or a fixed workflow instead. Starting simple is the most common advice from teams who ship agents in production.
The building blocks you'll learn in this tutorial
| Building block | What it does | Lesson |
|---|---|---|
| Tools | Give the model abilities beyond text | Tool Calling Explained |
| Agent loop | Repeats model → tools → model until done | Build an AI Agent in Python |
| Memory | Keeps context across steps and sessions | Memory, Planning & Reflection |
| Planning | Breaks big goals into smaller steps | Memory, Planning & Reflection |
| Orchestration | Splits work across several agents | Multi-Agent Systems & Safety |
| Guardrails | Limits, approvals and checks that keep agents safe | Multi-Agent Systems & Safety |
Skills students need for agentic AI
To build agents confidently you'll want:
- Python basics — functions, dictionaries, JSON and
pip. - How LLMs work — tokens, context windows and prompting (see the LLMs and Prompt Engineering tutorials).
- APIs — making HTTP requests and handling errors.
- Testing mindset — agents need evaluation, not just a demo that works once.
Common mistakes
- Building an agent for a fixed task. If the steps never change, a workflow is cheaper, faster and easier to debug.
- Giving the agent too many tools at once. Ten overlapping tools confuse the model; start with two or three clearly different ones.
- No step limit. Without a maximum number of loop iterations, a confused agent can loop forever and burn your API budget.
- Trusting tool calls blindly. The model can request a harmful or wrong action — validate inputs and require approval for anything destructive.
Key takeaways
- An AI agent is an LLM using tools in a loop until the goal is reached.
- Workflows follow a fixed path; agents choose the path at runtime.
- Your code — not the model — runs the tools, so you stay in control.
- Use agents only for multi-step tasks where the extra cost is worth it.