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.

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.

Chapter 7Machine Learning Essentials

Neural Networks from Scratch (The Intuition + a Tiny Build)

"Neural network" is one of those phrases that sounds like it requires a doctorate to understand. It does not. By the end of this chapter you will know exactly what a neural network is, because you will have built the smallest possible one yourself, in a few lines of code. The secret, which the intimidating name hides, is that a neural network is just numbers, multiplication, addition, and one simple bend — repeated many times. We build it from a single piece and assemble upward, so nothing is ever mysterious.

Chapter 8Machine Learning Essentials

Training a Model: Loss, Gradients, and Backpropagation

We left Chapter 7 with a neural network full of random weights, producing nonsense. This chapter answers the question that makes everything else possible: how does that random machine become genuinely skilled? The answer is **training**, and it turns out to be a surprisingly intuitive loop — measure how wrong you are, work out which way is better, take a small step, and repeat. We will build that intuition piece by piece, and even watch a tiny model learn in a handful of lines of code.

Chapter 9Machine Learning Essentials

Embeddings: Turning Meaning into Numbers

We have reached one of the most quietly important ideas in all of modern AI. Computers work only with numbers, yet we want them to work with the meaning of words. **Embeddings** are the bridge: they turn words, sentences, and whole documents into lists of numbers arranged so that *meaning becomes geometry*. This single idea powers search, memory, and the retrieval that grounds agents — including the RAG system you already built in Chapter 36. By the end of this chapter, the magic behind that system will be fully demystified.

← Part 1Part 3