AI Agents
Chatbots answer questions. Agents get things done.
An agent can research a topic across dozens of sources, write a report, and email it to your team—all while you're in a meeting. This track teaches you to build autonomous systems that work independently on complex, multi-step tasks.
Pro Tip
Already built chatbots? Great—you're halfway there. Agents add planning, tool use, and autonomy on top of what you already know.
What Makes an Agent?
Every agent follows the same loop:
| Phase | What Happens | Example |
|---|---|---|
| Observe | Gather context | Read the user's question, check current data |
| Think | Reason about the situation | "I need to search for recent data first" |
| Plan | Break into steps | Search → Read → Analyze → Write |
| Act | Execute using tools | Call search API, read documents |
| Reflect | Evaluate results | "Do I have enough information?" |
Types of Agents
Task-Specific Agents
Built for one job, done exceptionally well:
| Agent | What It Does | Tools It Uses |
|---|---|---|
| Code Reviewer | Analyzes PRs for bugs, security, style | Read, Grep, Glob |
| Research Agent | Gathers and synthesizes information | Web search, Document reader |
| Data Analyst | Queries databases, generates insights | SQL, Python, Charts |
| Support Agent | Handles tickets, searches knowledge base | KB search, CRM |
General-Purpose Agents
Flexible assistants for varied tasks:
- Personal Assistant: Calendar, email, task management
- Project Coordinator: Track work, manage workflows
- Problem Solver: Open-ended analysis and recommendations
Multi-Agent Systems
Multiple agents working together:
Sub-Agents: Divide and Conquer
Complex tasks need specialized workers. Sub-agents handle specific pieces of work with focused context and limited tools.
Why Sub-Agents?
| Benefit | Why It Matters |
|---|---|
| Context Isolation | Each sub-agent works with only relevant information—no overload |
| Parallelization | Run multiple sub-agents simultaneously |
| Tool Restrictions | Limit what each sub-agent can do for safety |
| Specialization | Each sub-agent has tailored prompts for its domain |
Built-in Sub-Agents
Claude Code includes ready-to-use sub-agents:
- Plan Sub-Agent: Dedicated planning with task breakdown
- Explore Sub-Agent: Fast, read-only codebase search
Creating Custom Sub-Agents
Define sub-agents as markdown files in .claude/agents/:
---name: code-reviewerdescription: Expert code review specialist for quality and security reviews.tools: Read, Grep, Glob--- You are a code review specialist. When reviewing code: 1. Identify security vulnerabilities (injection, auth issues)2. Check for performance problems (N+1 queries, memory leaks)3. Verify adherence to project coding standards4. Suggest specific, actionable improvements Be thorough but constructive. Explain *why* something is a problem.Common Tool Combinations
| Agent Type | Tools | Best For |
|---|---|---|
| Read-only | Read, Grep, Glob | Analysis, review, research |
| Test runner | Bash, Read, Grep | Test execution, CI tasks |
| Code modifier | Read, Edit, Write, Grep, Glob | Refactoring, generation |
Tools: The Agent's Hands
Agents need tools to interact with the world. Without tools, they can only talk. With tools, they can do.
Designing Good Tools
Clear purpose: Each tool does one thing well
# Good: specific"search_company_docs" - searches internal documentation # Bad: vague"search" - search what? where?Defined inputs: Specific parameters with types
{ "name": "search_docs", "input_schema": { "properties": { "query": {"type": "string", "description": "Search terms"}, "category": {"type": "string", "enum": ["policies", "products"]} } }}Predictable outputs: Consistent return format so the agent can parse results reliably.
Memory: The Agent's Mind
Agents need memory to maintain context across steps and conversations.
Short-term Memory
- Current conversation
- Working notes
- Intermediate results
Long-term Memory
- Past interactions
- Learned preferences
- Domain knowledge
Memory Strategies
| Strategy | Best For | How It Works |
|---|---|---|
| RAG | Knowledge bases | Search stored documents |
| Summarization | Long conversations | Compress old context |
| Key-value store | Facts and preferences | Quick lookup |
| Vector database | Semantic search | Find similar past content |
Track Modules
- 1
Building Agents
Learn to build agents from scratch using the Claude API.
You'll learn:
- Agent architecture patterns
- Tool implementation
- State management
- Error handling and recovery
- 2
Using Agents
Master prompting and get reliable results from any agent.
You'll learn:
- Writing effective system prompts
- Tool selection strategies
- Debugging agent behavior
- Advanced patterns (chain of thought, self-critique)
- 3
Agent Products
Ship production-ready agent systems that users pay for.
You'll learn:
- Product architecture
- User experience design
- Deployment and scaling
- Monetization models
Quick Start Example
Here's a minimal research agent:
from anthropic import Anthropic client = Anthropic() def research_agent(question: str) -> str: """Agent that researches a question using web search.""" tools = [{ "name": "web_search", "description": "Search the web for information", "input_schema": { "type": "object", "properties": { "query": {"type": "string"} }, "required": ["query"] } }] messages = [{ "role": "user", "content": f"""Research this question: {question} Use web_search to find information. Cite your sources in the final answer.""" }] # Agent loop while True: response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=4096, tools=tools, messages=messages ) if response.stop_reason == "tool_use": # Execute tools, add results, continue tool_results = execute_tools(response.content) messages.append({"role": "assistant", "content": response.content}) messages.append({"role": "user", "content": tool_results}) else: # Done - extract final text return extract_text(response.content)Best Practices
Start Simple
- One task, one tool: Get that working first
- Add tools gradually: One capability at a time
- Add memory when needed: Not before
- Split into sub-agents: When context gets too complex
Common Pitfalls
| Problem | Symptom | Fix |
|---|---|---|
| Infinite loops | Same action repeated | Detect loops, add exit conditions |
| Tool misuse | Wrong tool for task | Better tool descriptions |
| Context overflow | Degraded performance | Summarize, use sub-agents |
| Hallucination | Made-up tool results | Validate results, require citations |
| Cost explosion | Huge API bills | Token budgets, caching |
Safety First
- Human approval for sensitive actions (delete, send, pay)
- Rate limits and cost caps
- Logging all agent actions
- Sandboxed environments for testing
- Clear boundaries on what agents can/cannot do
Real-World Applications
Software
Code review, bug triage, doc generation, test creation
Support
Ticket routing, knowledge search, escalation, follow-up
Analysis
Report generation, anomaly detection, trend analysis
Content
Drafting, social scheduling, email campaigns, translation
Resources
- Claude Agent SDK — Official documentation
- Building Effective Agents — Anthropic research
- Tool Use Guide — API reference
- Anthropic Cookbook — Example implementations
Prerequisites
Before starting this track:
- Completed Start Here track
- Basic Python knowledge
- Familiarity with APIs (REST, HTTP)
- Understanding of LLMs (Claude, ChatGPT)
Success
Ready to build intelligent systems? Start with Building Agents to create your first agent from scratch.
Modules
Building Agents
Create AI agents from scratch using the Claude API
Using Agents Effectively
Master prompting, debugging, and getting reliable results from AI agents
Building Agent Products
Ship production-ready agent systems that users love and pay for