Build AI agents by writing them. Start from a bare loop and add tools, function calling, memory, RAG, multi-agent orchestration, MCP, guardrails, and evaluation — every lesson is runnable Python you paste and run.
Prerequisites
Take these first — the lessons assume you can read Python and write prompts:
Before you start
You will run real Python against a model API. You need Python 3.10+, the Anthropic SDK, and an API key from the Anthropic Console. The first lesson sets this up. The agent patterns are provider-agnostic — the course uses Claude so the code is concrete.
Set Up Your Workspace
Before building an agent, get a working Python environment with the Anthropic SDK and an API key, and make your first model call. This is the foundation every later lesson builds on.
The Agent Loop
Every agent is the same four-step loop — perceive, reason, act, observe — running until the task is done. Build the loop skeleton first, before adding any tools.
Defining Tools
A tool is a function the model can ask you to run, described by a name, a clear description, and a JSON-schema for its inputs. Write a tool the right way so the model calls it correctly.
Tool Use & Function Calling
Wire a tool to the model: pass it in the request, watch the model return a tool_use block, run your function, and hand the result back. This is the round trip every agent is built on.
Build an Agent From Scratch
Combine the loop and tool use into a real agent — one that keeps calling tools until the task is done, with the error and rate-limit handling that production needs.
The ReAct Pattern
ReAct = Reason + Act: the agent thinks, calls a tool, reads the result, thinks again. Turn on the model's reasoning so it plans between tool calls instead of guessing.
A RAG Agent
Give your agent a retrieval tool so it answers from your documents instead of its memory. Build the RAG pattern — a search tool the model calls — then point it at real data.
Agent Memory
An agent with no memory forgets everything between turns. Give it short-term memory inside the prompt, long-term memory that persists, and a strategy to keep it from overflowing.
Planner–Executor & Self-Critique
Two architectures that make agents more reliable — split planning from doing so the agent works to a plan, and add a critic pass so it checks its own work before finishing.
Multi-Agent Systems
Some jobs are better split across specialised agents than crammed into one. Build a two-agent system — a researcher and a writer — and have an orchestrator hand work between them.
Model Context Protocol (MCP)
MCP is an open standard that lets any agent connect to any tool server. Learn its core pieces, stand up a tiny MCP server, and connect it to Claude so the model can call its tools.
Real-World Tools & Safe Execution
Move past toy tools — wire up web search, code execution, and API calls, and run the dangerous ones safely with sandboxing and permissioning so the agent can act without doing harm.
Guardrails & Security
Agents take actions, so a bad input can cause real damage. Defend against prompt injection, redact sensitive data, validate every output, and keep a human in the loop for high-stakes calls.
Evaluating & Observing Agents
You can't improve what you can't measure. Track the right metrics, unit-test your tools, integration-test whole flows, and trace every step so you can see what your agent actually did.