AI Agents Explained
Move beyond chat. Agents take goals and achieve them autonomously, using tools, planning, and self-correction.
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)
| Chatbot | Agent |
|---|---|
| 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).
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
Think: I need to research AI safety first.
Act: Search the web for "AI safety basics."
Think: Good. I have sources. Now I'll outline the post.
Act: Create a post outline with intro, 3 key points, conclusion.
Think: Write the full post using the outline.
Act: Write blog post content.
Think: Format as HTML with proper tags.
Act: Convert to HTML with headings, paragraphs, links.
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
With just this goal, Claude's web search and code execution would:
- Search each website for today's headlines
- Extract headline text
- Identify common topics (AI, crypto, startups, etc.)
- Write Python code to count frequencies
- Create a bar chart visualization
- 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?
| Task | Chat or Agent? | Why |
|---|---|---|
| "Write a thank you email" | Chat | Quick, simple, one step |
| "Analyze this data file, create a chart, email results to team" | Agent | 3 steps, needs tools, async |
| "Brainstorm ideas for a blog" | Chat | Iterative, creative, conversational |
| "Download my social media stats, analyze trends, create a report PDF" | Agent | Multiple tools, multi-step |
| "Explain how photosynthesis works" | Chat | Knowledge, no tools needed |
Safety & Trust: When You Use Agents
Safety Rules for Agents
- Start with Reversible Tasks: Let agents read, analyze, and write. Don't let them delete or send without oversight first.
- Human-in-the-Loop: For critical actions, ask the AI to confirm before executing. Example: "I'm about to send this email. Confirm?"
- Clear Boundaries: Tell the agent what it CAN'T do. "Never delete folders. Never send emails without my approval."
- Test First: Run your agent task on test data before real data. See what it does.
- Monitor the First Run: Watch the agent work the first time. Understand its decision-making.
- Backup Before Big Tasks: If an agent will modify important files, back them up first.
3 Simple Agent Workflows You Can Try
Workflow 1: Research Agent
Goal: Deep research on a topic, with sources and synthesis.
Steps
- Tell Claude: 'Research [topic] with 5+ credible sources. Summarize key findings. Provide citations.'
- Claude searches the web, reads sources, synthesizes results.
- You get a comprehensive research summary with links.
Workflow 2: Document Agent
Goal: Process documents, extract insights, create summary.
Steps
- Upload a document (PDF, doc, spreadsheet).
- Tell Claude: 'Analyze this document. Extract: key insights, action items, risks, next steps. Format as a summary.'
- 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.
Steps
- Tell Claude: 'I want to [big goal]. Create a 4-week plan with weekly milestones, daily tasks, success metrics.'
- Claude thinks through the goal, breaks it down, identifies dependencies.
- 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
Conduct Research
- Go to claude.ai.
- 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.'
- Watch Claude work. It searches, reads sources, synthesizes.
Evaluate the Result
- Look at what Claude returned. Are the insights accurate?
- Are the sources credible? Check them.
- Ask Claude to refine: 'Go deeper on [specific insight]. I want more details.'
- 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
Find a Document
- Pick any document you have: PDF, Word doc, spreadsheet, long email, article.
- Ideally something with real content (not a placeholder).
Analyze It
- Go to claude.ai.
- Upload your document.
- Tell Claude: 'Analyze this document. Extract: main idea, key points (3-5 bullets), action items, any risks or concerns.'
- Claude reads it, understands context, delivers structured insights.
Track C: Code/Automation Agent (For Technical Users)
Difficulty: Medium | Time: 20-30 min
Set a Goal
- Think of something you could automate: process a CSV, create a chart, organize files, analyze data.
- Example: 'Analyze sales data from this CSV. Create a visualization. Save as PNG.'
Let Claude Do It
- Go to claude.ai.
- Upload your data file (if any).
- Tell Claude your goal.
- Claude will: understand what you need, write code, run it, iterate if needed, deliver the result.
- This is a full agent workflow — planning, coding, executing, self-correcting.
Agent: autonomous, multi-step, self-correcting | Chatbot: reactive, one-step, waits for guidance
Observe (current state) → Think (next step) → Act (execute) → Repeat until goal complete
Goal-directed | Has tools | Plans autonomously | Self-corrects
Web search | File reading | Code execution | Multi-step planning | Claude Code | Cowork Mode
Multiple clear steps | Needs tools | Async work | Repetitive | Requires adaptation | Complex goal
Start with reversible tasks | Human-in-the-loop for critical actions | Clear boundaries | Test first | Monitor first run | Backup before big tasks