What Is an AI Agent
An AI agent is a system that uses a model, a set of tools and a control loop to work toward a goal, deciding its own next step each time. A chatbot answers one message; a workflow follows steps a person designed; an agent plans, acts, looks at the result and decides what to do next, until the goal is reached or it stops.
A Travel-Planning Agent
Navika, in Dallas, asks an agent: "Plan a two-day trip to San Francisco to visit my sisters next month, under $600." A capable agent might work like this:
- Understand the goal: dates, budget, who she's visiting.
- Search flights with a flight tool, then compare prices and times.
- Search hotels near her sisters.
- Prepare an itinerary that fits the budget.
- Ask before booking: "Book this flight and hotel for $540?"
The model chose those steps itself, in that order, based on what each tool returned. That is what makes it an agent.
Chatbot vs Workflow vs Agent
| Chatbot | Workflow | Agent | |
|---|---|---|---|
| Who decides the steps | No steps: one reply per message | A person, in advance | The model, as it goes |
| Uses tools | Usually not | Yes, in a fixed order | Yes, chosen at each step |
| Predictability | High | High | Lower |
| Best for | Questions and drafts | Repeated, well-understood tasks | Open-ended tasks with unknown steps |
You met workflows in "Workflows vs Agents". Prefer a workflow whenever you can write the steps down; use an agent only when you can't.
Parts of an Agent
| Part | Description |
|---|---|
| Model | It is used to decide the next step and write the final answer |
| Tools | It is used to search, look up, calculate or act, such as booking or sending |
| Loop | It is used to repeat: call the model, run the tool it asks for, return the result |
| Short-term memory | The conversation so far, including every tool result, sent with each call |
| Long-term memory | Notes saved between sessions, such as preferences, stored by your code |
| Guardrails | Step limits, approvals, permissions and logs that keep the agent safe |
Common Mistakes
Building an agent for a fixed process. A workflow is cheaper, faster and easier to test.
Giving an agent every tool at once. More tools mean more ways to go wrong; add only what the task needs.
No limit on steps. A confused agent can loop, spending time and money.
Interview Corner
What makes a system an AI agent?
A model that decides its own next steps, tools it can call, and a loop that feeds tool results back until the goal is met or a limit is reached.
When should you use a workflow instead of an agent?
Whenever the steps are known in advance. Workflows are more predictable, cheaper and easier to test; agents suit open-ended tasks where the steps depend on what is found.
Practice
Exercise: agent or workflow? For each task, decide and explain: sending a monthly fee reminder email; researching three after-school programs and comparing them; resetting a forgotten password. Which one, if any, really needs an agent?
Check your understanding:
- What three parts make an agent?
- Who decides the steps in a workflow, and in an agent?
- Why did the travel agent ask before booking?
Key Takeaways
Quick reference
| Need | Choose |
|---|---|
| One answer | Chatbot |
| Known steps | Workflow |
| Unknown steps | Agent, with guardrails |
Was this tutorial helpful?