Building AI Agents
Three parts and ten modules for developers, each in five lessons: the essentials, going deeper, videos, practice and a check. One running project: a refund agent to build and measure.
Free, no account needed.
async function runAgent({ model, tools, prompt }) { const messages = [{ role: 'user', content: prompt }]; while (true) { const response = await model.create({ messages }); messages.push({ role: 'assistant', content: response.content }); if (response.stop_reason === 'end_turn') { return response.content.find((b) => b.type === 'text').text; }
The program
Part 1 of 3
The foundations
Understand what an agent really is, what it is made of and how it acts on the world.
3 modules. About 2 h 15.
- What an agent really isTell a model, a program and an agent apart, and know when an agent is the wrong choice.About 40 min
- Anatomy: components and memoryName the modules of an agent and choose the types of memory it actually needs.About 40 min
- Tools and MCPFollow a tool call from end to end and design tools a model uses correctly.About 55 min
Part 2 of 3
Building
Pick an architecture, split the work when it pays off and connect the agent to your data.
4 modules. About 3 h 45.
- Reasoning loops and architecturesChoose between ReAct and planning up front, then between one agent and a more complex setup.About 55 min
- Multi-agent systemsKnow when several agents are worth their coordination cost, and which structures are available.About 45 min
- Choosing a frameworkChoose by type of system rather than popularity, and know when to skip a framework.About 55 min
- Agentic RAGKnow what an agent adds to RAG, and when it only weighs the system down.About 1 h 10
Part 3 of 3
Reliability and delivery
Take an agent from a working demo to something you can trust, measure and ship.
3 modules. About 3 h 25.
- Governance and securityIdentify the risks an agent adds and put guardrails in the code, not just in the prompt.About 50 min
- Evaluating an agentBuild an evaluation set that tells you whether a change really improves the agent.About 1 h 45
- Use cases and final projectSpot real opportunities, avoid needless agents and ship a measured agent.About 50 min
Watch an agent work
The customer writes: “Order 4512 arrived broken. I want a refund.”
-
Thought
I’m missing the order details. I’ll look them up.Nobody wrote this path: the model chooses its next step. What an agent really is
-
Action
get_order(id=4512)The model asks, your code executes. Tools and MCP
-
Observation
{ "amount": 89, "delivered": "3 days ago" }This result enters working memory, which is limited. Anatomy: components and memory
-
Thought
I don’t know the rule. I’ll check the policy before deciding.The agent replans after each observation: that’s the ReAct loop. Reasoning loops and architectures
-
Action
search_policy("damaged item")The agent picks the source to query by itself. Agentic RAG
-
Observation
"Full refund within 30 days."A framework can run this loop for you. Choosing a framework
-
Thought
This case qualifies. I can prepare the refund.A second agent could check this reasoning. Is it worth the cost? Multi-agent systems
-
Action
refund(order=4512, amount=89) // awaiting approvalIrreversible action: the code requires a human, whatever the model says. Governance and security
-
Observation
"Approved by customer service. Refund issued."It all worked this time. How do you know it will across a thousand requests? Evaluating an agent
-
Answer
You’ve been refunded $89. It should arrive in 3 to 5 days.Did this task really need an agent? Use cases and final project