🤖Complete Beginner-to-Expert Guide

AI Agents: Zero to Hero

From Data and Models to Autonomous Agents — A Complete Beginner-to-Expert Guide. Free, open, and built for the era of autonomous AI.

51Chapters
10Parts
676Exercises
33Figures
What's Inside

Everything you need to build AI agents

🧠

LLM Foundations

Transformers, tokenization, attention, pretraining — understand what powers every agent.

🔧

Tool Use & Memory

Give agents hands and memory: web access, code execution, file tools, semantic memory.

🔍

RAG & Embeddings

Retrieval-Augmented Generation, vector databases, and semantic search from scratch.

🕸

Multi-Agent Systems

Orchestrate specialist agents, pipeline them, and coordinate complex workflows.

⚙️

LangGraph & CrewAI

Build with the leading frameworks — graph-based state machines and role-based teams.

🚀

Production Deployment

Guardrails, safety, cost optimization, monitoring, and deploying to the real world.

Curriculum

10 Parts — A complete learning path

Part 1 · 5 chapters
Foundations: The World of AI Agents
Before building anything, you need a clear mental model of what an agent is, why agents matter now, and the tools you will use throughout the book. This part assumes no prior AI experience and gets your workspace ready.
Part 2 · 4 chapters
Machine Learning Essentials
Agents run on models, and models are produced by machine learning. This part gives you a working understanding of how machines learn, how neural networks are trained, and what embeddings are — the foundation everything else stands on.
Part 3 · 5 chapters
Inside Large Language Models
Now we open the engine that powers every agent. You will learn how transformers work, how text becomes tokens, what attention does, and how these models are pretrained — explained simply, with no hand-waving.
Part 4 · 5 chapters
Data Preparation
Great models and useful agents both depend on good data. This part teaches the unglamorous but essential craft of collecting, cleaning, and shaping data for training and for retrieval.
Part 5 · 6 chapters
Training and Fine-Tuning Language Models
Here you learn how models are specialized: pretraining versus fine-tuning, efficient techniques like LoRA, instruction tuning, modern alignment methods, and how to evaluate the result honestly.
Part 6 · 5 chapters
Using Language Models in Practice
With the theory in place, we get practical: running inference, prompting effectively, getting structured outputs, and calling tools. These are the everyday skills you will use to build agents.
Part 7 · 7 chapters
The Core of AI Agents
This is the heart of the book. You will learn the building blocks every agent shares: the reasoning-and-acting loop, tools, memory, planning, and retrieval-augmented generation.
Part 8 · 5 chapters
Building Real-World Agents
Now we assemble everything into production-grade agents using modern frameworks, connect them to real tools through the Model Context Protocol, and coordinate multiple agents together.
Part 9 · 6 chapters
Advanced and Cutting-Edge Topics
The frontier moves fast. This part covers the latest approaches — agentic and graph-based RAG, evaluation and observability, safety and security, cost optimization with small models, and production deployment.
Part 10 · 3 chapters
Capstone Projects
Theory becomes mastery through building. Each capstone combines skills from across the book into a complete, portfolio-worthy agent you build end to end.
Featured

Start with Part I — Foundations

All 51 Chapters →
Chapter 1Foundations

What Is an AI Agent? From Chatbots to Autonomous Systems

We begin with the single most important idea in the book: what actually separates an *agent* from a plain chatbot or a script. By the end of this chapter you will be able to look at any AI product and say whether it is agentic, and why.

Chapter 2Foundations

Why Now? A Short History of AI, LLMs, and the Agentic Shift

The dream of building machines that can act on our behalf is not new — researchers have chased it since the 1950s, through waves of soaring hope and crushing disappointment. So why are useful agents suddenly possible now, in our decade and not an earlier one? This chapter answers that question by telling the story of how we got here. You do not need any technical background to follow it; think of it as a guided tour through seventy years of trying, failing, and finally succeeding. Understanding this arc will make everything that follows feel less like magic and more like the natural next chapter of a long story.

Chapter 3Foundations

Setting Up Your Workspace: Tools, Keys, and Environments

Every craft has a moment before the real work begins, when you lay out your tools and make sure everything is where it should be. A clean, repeatable setup is not glamorous, but it is the difference between spending your evenings building agents and spending them fighting error messages. In this chapter we install everything you need, one piece at a time, and we explain *why* each piece exists so that nothing feels like magic. By the end you will have a working environment and you will have made your very first call to a language model.

Chapter 4Foundations

A Gentle Programming Refresher for AI Builders

You do not need to be an expert programmer to build agents, but you do need to be comfortable reading and adapting a small amount of code. This chapter refreshes exactly that — the handful of Python ideas that appear again and again in the rest of the book, plus a glance at JavaScript so it never looks foreign. If you have programmed before, treat this as a warm-up. If you are new or rusty, go slowly and type every example yourself, because code, like a musical instrument, is learned by playing rather than by watching.

Chapter 5Foundations

The Math You Actually Need (Intuition First)

Many people approach anything labelled "math" with a flinch, bracing for walls of symbols. This chapter asks for none of that. We are not here to prove theorems; we are here to build *intuition* — a feel — for just three ideas that quietly power everything in AI: vectors, probability, and gradients. Each comes with a picture and a tiny example, and you will never be asked to derive anything. By the end, these words will feel like friends rather than threats, and the inner workings of later chapters will click into place.

Chapter 6Machine Learning Essentials

How Machines Learn: Core Concepts

In Chapter 2 we saw the great reversal at the heart of modern AI: instead of writing rules by hand, we show a machine examples and let it find the rules itself. That single idea — learning from data — is what this chapter unpacks. We will meet the three fundamental ways machines learn, define the small vocabulary you will hear in every AI conversation, and understand the one goal that everything in this field quietly serves. No code is required to follow it; the ideas are what matter, and they will anchor everything that comes after.

Free & Open

Ready to build your first agent?

Start with Chapter 1 — no prior AI experience required.

Begin Reading →View Solutions