Level 1Lesson 8⏱️ 55 min

AI Agents Explained

Move beyond chat. Agents take goals and achieve them autonomously, using tools, planning, and self-correction.

TeacherManagerDeveloperAnalystBusinessDoctor

What Is an AI Agent?

An AI agent is an AI that can work autonomously toward a goal. You give it a task, and it figures out the steps, executes them, and delivers the result. You don't have to guide every step.

Chatbot vs Agent (The Key Difference)

ChatbotAgent
You: "Analyze this data."You: "Analyze this data and email the results to my team."
AI: Returns analysis. Waits for next message.AI: Analyzes data, formats results, sends email, confirms done. All without asking.
You guide every step.AI figures out steps and executes them.
Reactive (responds to you)Proactive (works toward goal)

4 Properties of an AI Agent

1. Goal-Directed

Has a clear objective: "Write and schedule 5 social media posts for next week." Not "generate text."

2. Has Tools

Can use tools beyond just "thinking." Can read files, send emails, browse the web, execute code, use APIs.

3. Plans Autonomously

Breaks the goal into steps without you telling it. Doesn't ask permission for each step.

4. Self-Corrects

If a step fails, it adapts. "Email failed? Try again." "Data missing? Ask for it differently."

The Agent Loop: How Agents Work Internally

All agents follow the same basic loop: Observe → Think → Act → Observe (repeat).

STEP 1
OBSERVE
What's the current state? What tools are available?
STEP 2
THINK
What should I do next to reach my goal?
STEP 3
ACT
Execute the action (use a tool, write text, etc.)

The agent loops back to OBSERVE after each action. It checks: Did it work? What's next? Until the goal is complete.

Example: Agent Writing a Blog Post

Goal: "Write a blog post about AI safety for beginners, include 2 credible sources, format as HTML, and save it."
Loop 1:
Observe: No files yet, has access to web search and file writing.
Think: I need to research AI safety first.
Act: Search the web for "AI safety basics."
Loop 2:
Observe: Got 5 search results. Two look credible.
Think: Good. I have sources. Now I'll outline the post.
Act: Create a post outline with intro, 3 key points, conclusion.
Loop 3:
Observe: Outline done. No content yet.
Think: Write the full post using the outline.
Act: Write blog post content.
Loop 4:
Observe: Post written. Not formatted yet.
Think: Format as HTML with proper tags.
Act: Convert to HTML with headings, paragraphs, links.
Loop 5:
Observe: HTML complete. Goal is to save it.
Think: Save the file.
Act: Write file to "blog_post_ai_safety.html".
Observe: Done. Goal complete.

The agent didn't ask permission between steps. It observed, thought, acted, and moved forward. That's what makes it an agent, not a chatbot.

Real Agents You Can Use Today

Claude Code (Anthropic)

A CLI tool that runs Claude as an agent on your computer. Can read/write files, run code, execute commands. This is the most powerful for developers and power users.

ChatGPT with Tools (OpenAI)

In paid ChatGPT, you can enable code execution, web browsing, file uploads. The AI acts autonomously with these tools. Limited compared to Claude Code, but good for non-developers.

Perplexity (Perplexity AI)

An AI search engine that plans research queries, searches the web, and synthesizes results. Goals: deep research on any topic.

GitHub Copilot (Microsoft)

Understands code context, suggests implementations, refactors code, writes tests. Acts autonomously with your codebase. For developers only.

Zapier with AI (Zapier)

Connect 6000+ apps. AI decides which actions to take based on a goal. Example: "Archive emails, log them to a sheet, and send a summary weekly."

Agentic Features in Claude

Claude has several agentic capabilities. In this course, we'll focus on Claude Code (the most powerful), but here's what all of them are:

Claude's Agentic Toolkit

  • Web Search: Claude can search the internet and cite sources. Goal: "Research recent AI regulations."
  • File Reading: You upload files (CSV, PDF, code). Claude reads and analyzes them autonomously.
  • Code Execution: Claude can write Python code and see the output. Test hypotheses, create visualizations.
  • Multi-Step Planning: Claude breaks complex tasks into steps and executes them without you guiding each one.
  • Claude Code: A CLI tool where Claude acts as a full agent on your computer (read/write files, run commands, code execution).
  • Cowork Mode: For non-developers, Claude Code lets you watch and collaborate as Claude works on your computer.

Real Example: Multi-Step Agent Task

Task: Analyze Website Trends
Your goal: "Visit the top 3 tech news websites. Find the most common topics in today's headlines. Create a summary visualization. Save as HTML."

With just this goal, Claude's web search and code execution would:

  1. Search each website for today's headlines
  2. Extract headline text
  3. Identify common topics (AI, crypto, startups, etc.)
  4. Write Python code to count frequencies
  5. Create a bar chart visualization
  6. Wrap it in HTML and save

All because you stated the goal. No step-by-step prompting needed.

When to Use Agents vs Chat (Decision Framework)

Use Chat When:

  • You need a quick answer or draft ("write an email", "explain this concept")
  • You want to iterate and refine in a conversation
  • The task is simple (one or two steps)
  • You're exploring ideas and want feedback
  • You need creative brainstorming

Use Agents When:

  • The task has multiple clear steps (research, analyze, format, save)
  • The AI needs to use tools (read files, write files, search, code)
  • You want the AI to work while you do something else
  • The task is repetitive and you want to automate it
  • The AI needs to self-correct or adapt if something fails
  • You want to hand off a goal and come back to a finished result

Examples: Which Mode?

TaskChat or Agent?Why
"Write a thank you email"ChatQuick, simple, one step
"Analyze this data file, create a chart, email results to team"Agent3 steps, needs tools, async
"Brainstorm ideas for a blog"ChatIterative, creative, conversational
"Download my social media stats, analyze trends, create a report PDF"AgentMultiple tools, multi-step
"Explain how photosynthesis works"ChatKnowledge, no tools needed

Safety & Trust: When You Use Agents

⚠️
Critical: Agents can take irreversible actions. They can delete files, send emails, execute commands. Before giving an agent a goal, think: "What's the worst that could happen?"

Safety Rules for Agents

  1. Start with Reversible Tasks: Let agents read, analyze, and write. Don't let them delete or send without oversight first.
  2. Human-in-the-Loop: For critical actions, ask the AI to confirm before executing. Example: "I'm about to send this email. Confirm?"
  3. Clear Boundaries: Tell the agent what it CAN'T do. "Never delete folders. Never send emails without my approval."
  4. Test First: Run your agent task on test data before real data. See what it does.
  5. Monitor the First Run: Watch the agent work the first time. Understand its decision-making.
  6. Backup Before Big Tasks: If an agent will modify important files, back them up first.
💡
Claude Code has built-in safeguards. It asks for confirmation before: - Deleting files - Running system commands - Sending messages/emails - Making irreversible changes

3 Simple Agent Workflows You Can Try

Workflow 1: Research Agent

Goal: Deep research on a topic, with sources and synthesis.

🖥️HANDS-ON EXERCISE0

Steps

  1. Tell Claude: 'Research [topic] with 5+ credible sources. Summarize key findings. Provide citations.'
  2. Claude searches the web, reads sources, synthesizes results.
  3. You get a comprehensive research summary with links.

Workflow 2: Document Agent

Goal: Process documents, extract insights, create summary.

🖥️HANDS-ON EXERCISE0

Steps

  1. Upload a document (PDF, doc, spreadsheet).
  2. Tell Claude: 'Analyze this document. Extract: key insights, action items, risks, next steps. Format as a summary.'
  3. Claude reads the document, understands context, delivers structured insights.

Workflow 3: Planning Agent

Goal: Take a goal, create a detailed plan, break it into steps.

🖥️HANDS-ON EXERCISE0

Steps

  1. Tell Claude: 'I want to [big goal]. Create a 4-week plan with weekly milestones, daily tasks, success metrics.'
  2. Claude thinks through the goal, breaks it down, identifies dependencies.
  3. You get a detailed, actionable plan.

Hands-On: Your First Agent Task (3 Tracks)

Choose ONE track below based on your comfort level. All three are valid ways to experience agents.

Track A: Research Agent (For Everyone)

Difficulty: Easy | Time: 15-20 min

🖥️HANDS-ON EXERCISE 15 min

Conduct Research

  1. Go to claude.ai.
  2. Tell Claude: 'Research [topic you care about, e.g., 'the latest AI safety concerns']. Find 3+ credible sources. Summarize the key insights and provide citations.'
  3. Watch Claude work. It searches, reads sources, synthesizes.
🖥️HANDS-ON EXERCISE 210 min

Evaluate the Result

  1. Look at what Claude returned. Are the insights accurate?
  2. Are the sources credible? Check them.
  3. Ask Claude to refine: 'Go deeper on [specific insight]. I want more details.'
  4. Note: This is Claude acting like an agent — planning steps, using tools (search), delivering results.

Track B: Document Agent (For Everyone)

Difficulty: Easy | Time: 10-15 min

🖥️HANDS-ON EXERCISE 13 min

Find a Document

  1. Pick any document you have: PDF, Word doc, spreadsheet, long email, article.
  2. Ideally something with real content (not a placeholder).
🖥️HANDS-ON EXERCISE 210 min

Analyze It

  1. Go to claude.ai.
  2. Upload your document.
  3. Tell Claude: 'Analyze this document. Extract: main idea, key points (3-5 bullets), action items, any risks or concerns.'
  4. Claude reads it, understands context, delivers structured insights.

Track C: Code/Automation Agent (For Technical Users)

Difficulty: Medium | Time: 20-30 min

🖥️HANDS-ON EXERCISE 15 min

Set a Goal

  1. Think of something you could automate: process a CSV, create a chart, organize files, analyze data.
  2. Example: 'Analyze sales data from this CSV. Create a visualization. Save as PNG.'
🖥️HANDS-ON EXERCISE 215 min

Let Claude Do It

  1. Go to claude.ai.
  2. Upload your data file (if any).
  3. Tell Claude your goal.
  4. Claude will: understand what you need, write code, run it, iterate if needed, deliver the result.
  5. This is a full agent workflow — planning, coding, executing, self-correcting.
AI Agents Quick Reference
Agent vs Chatbot

Agent: autonomous, multi-step, self-correcting | Chatbot: reactive, one-step, waits for guidance

The Agent Loop

Observe (current state) → Think (next step) → Act (execute) → Repeat until goal complete

4 Agent Properties

Goal-directed | Has tools | Plans autonomously | Self-corrects

Claude's Agentic Features

Web search | File reading | Code execution | Multi-step planning | Claude Code | Cowork Mode

When to Use Agents

Multiple clear steps | Needs tools | Async work | Repetitive | Requires adaptation | Complex goal

Safety Rules

Start with reversible tasks | Human-in-the-loop for critical actions | Clear boundaries | Test first | Monitor first run | Backup before big tasks