AI Agents Course
Understand how AI agents plan, use tools, and remember context, then learn to design and ship your own.
36 lessons · about 10 hours of reading · Free
Start lesson 1Course syllabus36 Lessons
What Is an AI Agent? A Beginner's Guide to How Agents Work
Learn what an AI agent is, how it differs from a chatbot and a workflow, what parts it is made of, where agents are used today, and when you should not build one.
How LLMs Work: Tokens, Context Windows and Embeddings for Agent Builders
Learn the parts of a large language model that matter when you build AI agents: tokens, context windows, how a reply is generated, why long conversations cost more, and what embeddings are for.
Choosing and Configuring a Model for Your AI Agent
Learn how to pick a model for an agent and set it up well: temperature and top-p, stop reasons, reasoning and effort, open versus closed models, streaming, token pricing, and when to fine-tune instead of prompt.
The Agent Loop Explained: Perceive, Reason, Act, Observe
Learn how the agent loop works step by step: how the model asks for a tool, how your code runs it and reports back, what a turn is, what ends the loop, and how to write the loop yourself in a few lines of Python.
Workflows or Agents? How to Decide What to Build
Learn how to choose between a single model call, a workflow and an agent. A ladder of complexity, a four-question checklist, real cost numbers, worked examples, and why you should start simple and measure.
Build Your First AI Agent From Scratch in Python
Build a small working AI agent in Python with direct Claude API calls. Set up your key, define two tools, write the loop, print every step, protect against a bad file path, and stop safely.
Function Calling Across Providers: Claude, OpenAI and Gemini
Learn the one pattern behind tool use on every major model API, then see how Claude, OpenAI and Gemini each spell it. Compare request and result formats side by side and write tools once so they work on any provider.
Errors, Retries and Rate Limits: Keep Your AI Agent From Crashing
Learn how to make an AI agent survive real-world failures. Understand API error codes, automatic retries and backoff, rate limits and their headers, tool errors the model can recover from, and the guards that stop a failing loop.
How to Write Tool Definitions and Get Structured Output From an AI Agent
Learn how to write a tool definition the model uses correctly: names, descriptions, JSON Schema inputs and examples. Then validate the arguments the model produces, use strict mode, and get structured JSON output.
Designing Tools That Work: How to Make an AI Agent Better by Fixing Its Tools
Learn how to design tools an AI agent uses well. Choose the right tools, name and describe them clearly, return useful and short results, make mistakes hard to make, and improve them with a simple test loop.
Common AI Agent Tools: Web Search, Code Execution, Databases, APIs and Email
Learn the standard tools AI agents use, from web search and code execution to database queries, API calls and email. See what each one can do, what could go wrong, and the permission and guard each one needs.
Computer Use and Web Browsing Agents: How They Work and When to Avoid Them
Learn how AI agents operate a screen or a browser. Understand the screenshot, action, result loop, the browser use tool, how to set up a safe environment, why these agents are slower and less reliable than API tools, and the safety rules.
MCP Explained: The Model Context Protocol for AI Agents
Learn what the Model Context Protocol (MCP) is, why it exists, and how hosts, clients and servers fit together. Understand tools, resources and prompts, local and remote servers, how an agent uses MCP tools, and when to choose MCP over your own tools.
Build and Deploy an MCP Server in Python
Build a small MCP server in Python that exposes tools, test it, connect it to a desktop app, and learn how to run it remotely. Covers the stdio logging rule, local versus remote deployment, and the security basics every server needs.
Prompting for Agents: How to Write System Prompts an AI Agent Can Follow
Learn how to write instructions an AI agent follows reliably. Cover the anatomy of an agent system prompt, clarity, context, examples, XML structure, tool and action guidance, safety rules, and a simple way to test prompt changes.
Context Engineering for AI Agents: What to Put in the Context Window
Learn context engineering for AI agents: why the context window is a limited resource, what fills it, how to keep it lean with trimming, just-in-time retrieval, compaction, notes and sub-agents, and what to keep, summarize or drop.
AI Agent Memory: Short-Term vs Long-Term, and Where Each Lives
Learn how AI agent memory works. Tell short-term from long-term memory, episodic from semantic and procedural, choose files, a database or a vector store, build a Claude memory tool handler safely, and know when memory helps and when it hurts.
Maintaining Agent Memory: Updating, Summarizing, Retrieving and Forgetting
Learn how to keep AI agent memory useful over time. Decide what to save, update facts instead of piling up duplicates, store a user profile, summarize old logs, retrieve only what is relevant, forget on purpose and protect privacy.
RAG and Vector Databases Explained: How Agents Search Your Documents
Learn how retrieval-augmented generation (RAG) works. Understand embeddings, chunking, vector databases, keyword search and hybrid ranking, contextual retrieval and reranking, how to measure retrieval, and when to skip RAG for long context.
Build a RAG Agent in Python That Answers From Your Documents With Citations
Build a RAG agent step by step. Chunk documents by heading, build a hybrid search index, give the agent a search tool that returns citable results, show sources with every answer, and check that the answers and citations are real.
ReAct and Chain of Thought: How AI Agents Reason and Act
Learn how AI agents combine reasoning and action. Understand chain of thought, the ReAct pattern of thought, action and observation, build a ReAct loop from scratch in Python, use Claude's adaptive thinking between tool calls, and know the limits of visible reasoning.
Planner-Executor, DAG Agents and Tree of Thought: Planning Architectures Explained
Learn how to plan before acting. Separate a planner from an executor, run independent steps in parallel with a dependency graph, explore several paths with tree of thought, and choose between these designs and a plain ReAct loop. Includes tested Python code.
Self-Critique and Evaluator-Optimizer: Improve Agent Output with a Review Loop
Learn how to make an agent check and improve its own work. Build a generate-and-evaluate loop, choose between rules, a model judge and a person, set stopping rules, and learn when iteration helps and when it only burns tokens. Includes tested Python code.
Chaining, Routing and Parallelization: Three Core Workflow Patterns for AI Agents
Learn the three building blocks behind most reliable LLM systems. Chain prompts with gates between steps, route each input to the right handler or model size, and run calls in parallel for speed or for voting. Includes tested Python code.
Orchestrator-Workers and Multi-Agent Systems: When to Use More Than One Agent
Learn how a lead agent splits a task, hands pieces to worker agents and combines the results. See what multi-agent systems gain, what they cost, how to write a good handoff, where they fail, and when a single agent is the better choice. Includes tested Python code.
Human-in-the-Loop Agents: Approval Gates, Checkpoints and Safe Oversight
Learn where a person belongs in an agent's workflow. Decide which actions need approval, build an approval gate that shows the exact action, handle approve, reject and edit, avoid approval fatigue, and design reviews that people can do quickly. Includes tested Python code.
Testing AI Agents: Unit Tests, Mocked Models and Handling Non-Determinism
Learn how to test an agent in layers. Unit test the tools, mock the model with scripted replies to test the loop, check what the agent sends back, handle flaky output, and know where ordinary tests stop and evaluations begin. Includes tested Python and pytest code.
Evaluating AI Agents: Evals, Graders, Metrics and pass@k
Learn how to measure whether an agent is actually good. Build a test set from real failures, grade outcomes with code, models and people, run several trials, read pass@k and pass^k, track the right metrics, catch regressions, and see where Ragas and DeepEval fit. Includes tested Python code.
Observability and Tracing for AI Agents: See What Your Agent Did and Why
Learn how to see inside an agent. Record traces with spans for each run, model call and tool call, decide what to log and what to keep out, debug failures from a trace, monitor an agent in production, and compare tools such as OpenTelemetry, OpenLLMetry, Langfuse, LangSmith and Helicone. Includes tested Python code.
Prompt Injection and Tool Sandboxing: Protect AI Agents from Hostile Input
Learn how attackers hide instructions in web pages, emails and files, why agents are exposed, and how to defend in layers. Remove dangerous capability combinations, sandbox tools, allowlist outbound requests, track untrusted content, and keep a person in the loop. Includes tested Python code and honest limits.
Privacy, Bias and Red Teaming: Responsible Practices for AI Agents
Learn how to handle personal data, test for unfair behavior and attack your own agent before others do. Redact and minimize data, pseudonymize and restore it, run counterfactual and rate-gap checks for bias, and build a red-team harness with canary tokens. Includes tested Python code and clear limits.
Agent Cost and Latency: Make AI Agents Cheaper and Faster Without Losing Quality
Learn where an agent's money and time go, and how to cut both. Understand why every step re-sends the whole history, use prompt caching, pick the right model and effort, trim tokens, batch non-urgent work, stream and parallelize, and set budgets. Includes tested Python cost code and current price notes.
AI Agent Frameworks Compared: Build Directly or Use LangGraph, CrewAI, the Agents SDKs and More
Learn what an agent framework actually does by reading a 64-line one, then compare the main options: the Claude Agent SDK, OpenAI Agents SDK, LangGraph, CrewAI, AutoGen, Google ADK, Pydantic AI, smolagents, LlamaIndex, Haystack and Agno. Get a decision guide, selection checklist and tips for avoiding lock-in. Includes tested Python code.
Deploying AI Agents: Hosting, Queues, State, Secrets and Safe Releases
Learn how to run an agent in production. Choose between serverless functions, workers behind a queue, durable workflow engines and provider-hosted agents, then build the core of a durable job runner with checkpoints, leases, idempotency and retries. Covers secrets, monitoring and rollbacks. Includes tested Python code.
Walkthrough: Build a Customer Support Agent with Tools, Approvals, Guardrails and Evals
Put the whole course together in one project. Design a customer support agent that looks up orders, searches a help center, issues refunds only with human approval, escalates cleanly, resists hostile text, is tested with a scripted model, evaluated on real tasks and measured by resolution quality. Includes tested Python code.
Walkthrough: Build a Research Agent with Parallel Workers, Citations and Source Checking
The final project of the course. Build a research agent that splits a question across parallel workers, reads sources through guarded tools, saves quote-checked findings to a shared notebook, writes a cited report, checks every line, and stays inside a budget. Learn what citation checks prove and what they cannot. Includes tested Python code.
Related courses
Get AI Agents by email
One lesson a week, in order. Free, and you can unsubscribe from any email.
Frequently asked questions
How long does the AI Agents course take?
It has 36 lessons and about 10 hours of reading, before you spend time on the practice tasks. Go at your own pace; the lessons are written to be done in order.
Is the AI Agents course free?
Yes. Every lesson is free to read, and you do not need to sign in.