Learn & Build Agents
Understand how an AI agent works from the inside: short lessons in animated diagrams where you switch parts on and off and see what changes.
Start with lesson 1 →Your progress stays in this browser only. No login and no cookies.
Switch a piece off
Remove a piece of the agent and see what changes in the answer.
- 25 lessons
- 73 hands-on steps
- 148 sources cited
- 17 real cases
Where to start, depending on your role
- I’m a PM deciding whether an agent is worth itWhen an agent pays off, when a fixed flow is enough, and how to prove the value.Start with: When not to use an agent →
- I’m a developer building my first agentWhat the model does, what your code does, and how the two talk.Start with: Tools and the loop →
- I need to evaluate a vendor’s agentWhat to ask and what to test before you trust an agent another company built.Start with: Vetting a vendor’s agent →
Foundations
Where to start: what an agent is and what happens in a call to the LLM.
What an agent is
The same customer question, answered better each time: model, prompt, tools, loop and limits. The pieces of an agent, in order, and what each one changes.What an LLM is, and why it makes things up
Watch the model write one piece at a time, drawn from the most likely ones. Put the order data in the text and watch the answer change: it only knows what it reads.Tokens, context and the cost of a call
See the store agent's call piece by piece, with the price of each one. Run the conversation turn by turn, turn on the cache and watch the bill drop, and then break the cache by accident.Writing the agent's prompt
The system prompt in four blocks: role, rules, when to hand off to a person and examples. Turn off one at a time and watch the store agent get it wrong.Why the answer varies
The same message, three different answers from the agent. Run it again, play with the draw, put a rule in the prompt and see why testing once is not enough.Structured output (JSON)
The support agent returns { intencao, numero_pedido } so the code can pick the path. Break the format, turn on the schema, watch a made-up number slip through and put the check in code.Building the agent
From a bare model to an agent with tools, a loop and the code around it.
Tools and the loop
How the store agent looks things up and acts: the model asks for the tool, your code runs it, and the result goes into the conversation for the next turn. Turn off the description, step through the turns and break the refund.Workflow or agent
The same support service built two ways, in the same places on screen. Send the same messages to both and see who decides the path, who fails silently and what freedom costs.The harness: the code around the model
The agent worked on the happy path. Now break it on purpose: take down the API, freeze the tool, trap the loop, and see which piece catches each failure.The agent's architecture
The pieces from the earlier lessons become files in a project. Click a file and light up the agent piece it implements; then see the map that guides whoever writes the code.Context and memory
The customer comes back the next day and asks "what about that exchange?". The model only knows what is in the call's context: what to put there, what to summarize, what to keep between conversations and what never to keep.Search and RAG
The return policy fits whole in the context, and then search does not pay off. When the base grows, RAG comes in: chunks, vectors, the question's neighbors, and the trap of the passage that is similar but wrong.Search that gets it right
Search by meaning misses the error code the customer typed. How to measure the search before the answer, combine word and meaning, reorder with a reranker, and when to let the agent search on its own.MCP: tools for any agent
The store wants the same buscar_pedido in the chat, in the team assistant and on WhatsApp. Write it three times, or once in an MCP server? And what changes when any agent can connect.Agentic architectures
When to use a workflow, an agent or several agents.
Patterns and multiple agents
Who decides the path: the code, an LLM call or a lead agent? Chaining, routing, splitting among workers, watching and delegating to subagents, in the same store support.Human in the loop and guardrails
How far the store's agent decides on its own, where the person approves and why the money rule lives in the code, not in the prompt.Security: prompt injection
How a text the agent reads turns into an order, why a filter is not enough, and how the store cuts one of the three legs of the attack in code.Trust in production
How to know it works, and find where it broke.
Evals: dataset, rubric and LLM judge
How to know whether the store’s agent answered well: a fixed test set, checks in code, a rubric and a judge you compare with your own labels before trusting it.Prompts in production: versions and regressions
An improvement to the store agent’s prompt breaks the size exchange. How to catch it before the customer does: versions, the same eval and a case-by-case comparison.Traces and failure modes
The agent said it refunded, and the money never went out. The trace of each step shows where it broke; a taxonomy names the failure; and each real failure becomes a test.Cost and latency per run
The price of one call is easy to see. The price of a whole conversation, with the loop, is not. Where the time and money go, and the levers that matter most.From prototype to product
The PM questions that decide whether it is worth it.