What is an AI Agent? 🤖
An AI agent is a system that perceives its environment and takes actions to achieve a goal. Unlike a normal LLM (which just talks), an agent can actually DO things in the real world — click links, send emails, control robots, play games.
The key formula:
AI Agent = Brain + Tools + Memory + Goal
The "brain" can be simple rules (like a thermostat) or a giant LLM (like Claude). The "tools" are functions the agent can call (search the web, send messages, control devices). The "memory" lets it remember past actions. The "goal" tells it what to achieve.
The Agent Loop 🔄
All agents — simple or fancy — follow a similar loop:
- Perceive — sense the environment (read a sensor, see a screen)
- Think — decide what to do
- Act — take an action
- Observe — check the result
- Repeat — go back to step 1
Different agent types do this loop in different ways. Some skip steps. Some have memory of past loops. Let's see all 6!
1. Simple Reflex Agent 🚪
The simplest type. Uses pure if-then rules: "IF condition X, THEN do Y." No memory, no planning, no learning.
Real-world examples:
- Automatic door — IF motion detected, THEN open door
- Thermostat — IF temp below 68°F, THEN turn on heater
- Motion-activated lights — IF motion, THEN turn on light
- Spam filter (basic) — IF email contains "FREE MONEY!", THEN flag as spam
Simple Reflex agents are dumb but reliable. They work great for narrow tasks where the rules are clear.
2. Model-Based Reflex Agent 🤖
Has memory! Keeps an internal "model" of the world based on what it's seen so far. Can handle situations where you can't see everything at once.
Real-world examples:
- Roomba vacuum — remembers a map of your house, where it's already cleaned
- Pac-Man ghosts — remember where Pac-Man went last
- Old GPS systems — remember your past route
- Inventory tracking systems — remember what's in stock
3. Goal-Based Agent 🎯
Has a goal and plans how to reach it. Considers multiple actions and picks the one that gets closer to the goal.
Real-world examples:
- Google Maps navigation — goal: reach destination. Plans best route.
- Chess engines — goal: checkmate. Plans many moves ahead.
- Waymo self-driving cars — goal: arrive safely. Plans driving path.
- Robot delivery — goal: deliver package. Plans path through building.
4. Utility-Based Agent ⚖️
Goes beyond just "reach goal" — picks the BEST option among many possibilities. Uses a utility function that scores how "good" each outcome is.
Example: Goal-based agent picks ANY route to the airport. Utility-based agent picks the BEST route — fastest, lowest tolls, smoothest, etc.
Real-world examples:
- Travel booking apps — best flight balancing price, time, layovers
- Uber pricing — best price balancing demand, supply, time
- Amazon recommendations — best products balancing price, ratings, your taste
- Investment advisors — best portfolio balancing risk and return
5. Learning Agent 🧠
Improves over time! Learns from feedback and experience. Gets better at the task the more it does it.
Real-world examples:
- Netflix recommendations — learns your taste from what you watch
- TikTok For You feed — learns your interests from your scroll patterns
- AlphaGo — learned Go by playing millions of games against itself
- Tesla Autopilot — improves with millions of miles of driving data
- Spam filters (modern) — learn from when you mark stuff as spam
6. LLM-Powered Agent ⭐
The newest and most flexible type! Uses a Large Language Model as its brain, plus a set of tools.
You describe what you want in plain English, the LLM figures out the steps, calls the right tools, and reports back. The most flexible because LLMs can handle almost any task you describe in words!
Real-world examples:
- Claude Code — codes, debugs, runs tests autonomously
- ChatGPT with tools — searches web, runs code, generates images
- Cursor — AI coding assistant that edits files
- Devin — autonomous AI software engineer
- Deep Research agents — browse multiple websites, synthesize reports
Comparing All 6 Types 📊
| Type | Memory? | Plans? | Learns? | Example |
|---|---|---|---|---|
| 1. Simple Reflex | ❌ No | ❌ No | ❌ No | Auto door |
| 2. Model-Based | ✅ Yes | ❌ No | ❌ No | Roomba |
| 3. Goal-Based | ✅ Yes | ✅ Yes | ❌ No | Google Maps |
| 4. Utility-Based | ✅ Yes | ✅ Yes | ⚪ Some | Travel apps |
| 5. Learning | ✅ Yes | ✅ Yes | ✅ Yes | Netflix |
| 6. LLM-Powered | ✅ Yes | ✅ Yes | ✅ Yes | Claude Code |
LLM vs LLM-Powered Agent 🤔
This is a common question! What's the difference?
- An LLM can only TALK. You give it text, it gives you text back. That's it.
- An LLM-Powered Agent can TAKE ACTIONS. The LLM is the brain, but it has tools to actually DO things — search the web, send email, run code, control devices.
So when you chat with raw ChatGPT, that's an LLM. When ChatGPT searches the web for you and clicks links — that's an LLM-Powered Agent!
Tool Use: How Agents Take Action 🛠️
Tool use (also called function calling) is how an LLM agent does anything beyond text. The developer pre-defines a list of tools the agent can use:
- web_search(query) — search the internet
- send_email(to, subject, body) — send an email
- read_file(path) — read a file
- create_calendar_event(time, title) — add to your calendar
- execute_code(code) — run Python or another language
The LLM decides which tool to call and with what parameters. The tool runs, returns a result, and the LLM continues based on what it sees.
What is MCP? 🔗
MCP (Model Context Protocol) is a new standard introduced by Anthropic for letting AI agents connect to external tools and data sources safely. Think of it like USB-C for AI — a universal way to plug agents into databases, files, APIs, and apps.
MCP is becoming the industry standard for agent tooling. Even OpenAI and Google have adopted it!
Multi-Agent Systems 👯
Sometimes you put MULTIPLE agents together, each with a different role — like a team!
Example: A research project might use:
- Researcher Agent — searches the web
- Writer Agent — drafts the report
- Editor Agent — checks for errors
- Coordinator Agent — manages the others
Multi-agent systems are an active research area. They might be the future of how AI helps us!
Agent Concerns ⚠️
AI agents are powerful — and that means new risks:
- Tool hallucination — agent invents a tool that doesn't exist
- Reward hacking — agent finds loopholes that maximize reward without achieving the real goal
- Acting too autonomously — taking actions you didn't approve
- Privacy — agents need access to your data to be helpful
- Security — bad actors could trick agents into doing harmful things
This is why "AI alignment" research is so important — making sure agents do what we ACTUALLY want, not just what we literally said.
Important Vocabulary 📚
- Agent — software that perceives + acts to achieve goals
- Environment — the world the agent senses and acts in
- Policy — agent's strategy for choosing actions
- Utility function — scores outcomes (higher = better)
- Tool use / Function calling — agent calling external functions
- ReAct — Reasoning + Acting interleaved
- MCP — Model Context Protocol (standard for agent tools)
- Multi-agent system — multiple agents working together
- Embodied AI — agents with physical bodies (robots)
- Autonomous — acts without constant human input
Common Questions & Answers 🎯
Q: An automatic door is what kind of agent?
A: Simple Reflex Agent.
Q: Roomba vacuum is what kind of agent?
A: Model-Based Agent (it remembers a map of your house).
Q: Google Maps planning routes is what kind of agent?
A: Goal-Based Agent.
Q: Netflix recommending movies is what kind of agent?
A: Learning Agent.
Q: What's the formula for an AI agent?
A: AI Agent = Brain + Tools + Memory + Goal.
Q: What's the difference between an LLM and an LLM-Powered Agent?
A: An LLM only generates text. An LLM-Powered Agent uses tools to take real-world actions.
What's Next? 👉
- 👉 Large Language Models — the brains behind modern agents
- 👉 Generative AI — the GenAI side
- 👉 Machine Learning — refresher on ML basics