Free book · 14 chapters and 5 deep dives · Book 1 in the library

AI Foundations: from zero

You do not need to know any technology, mathematics or programming. This free book explains how AI really works, one small step at a time, with everyday examples and a picture in every chapter. Read it in order, or jump to the chapter you need.

Two levels. The main chapters are Level 1: the whole story in plain words. After some chapters you will find an optional Level 2 deep dive (the dashed, indented entries). Deep dives go one step further, with worked numbers and more diagrams, and are still in plain words. Skip them on a first read, or open them when you want to see exactly how something works.

It is the starting point of the Keshava AI book library. The next book, From One Call to a Platform, starts where this one ends: how to build AI systems that you can trust.

  1. Start here: The map of this bookWhat this free book is for, who it is for, and the whole journey in one picture. (4 min)
  2. Chapter 1: Technology in ten minutesSoftware, data, apps, servers, databases and the cloud, explained with a kitchen and a restaurant. (5 min)
  3. Chapter 2: What do we mean by AI?AI, machine learning, deep learning and generative AI, told apart with a simple family tree and one big idea: rules versus learning. (4 min)
  4. Chapter 3: Machine learning: learning from examplesHow a computer learns by guessing, checking and adjusting, why you keep an exam pile secret, how to tell if a model is any good, and the ten-step workflow from idea to a working system. (8 min)
  5. Deep dive A: The machine learning workflow, step by stepLevel 2. Each of the ten steps in detail: what you do, what goes wrong, and what to check, with a message sorter as the running example. (11 min)
  6. Chapter 4: Neural networks and deep learningHow a tiny artificial voter works, how thousands of them are joined into layers, and how the network learns by walking downhill. (6 min)
  7. Deep dive B: Inside a neural network: structure, learning and updatesLevel 2. A tiny network worked by hand: the forward pass, the loss, backpropagation and one parameter update, with every number shown. (11 min)
  8. Chapter 5: From words to numbersHow text is cut into tokens, turned into lists of numbers that capture meaning, and stored on a shelf that can be searched by meaning. (6 min)
  9. Deep dive C: Embeddings and vector databases, in depthLevel 2. Where embeddings come from, how closeness is measured with real numbers, and why a special kind of database exists to search them. (10 min)
  10. Chapter 6: Attention and the transformerHow a model decides which words matter most when it reads, and the design, the transformer, that made today's language models possible. (6 min)
  11. Deep dive D: The transformer, step by stepLevel 2. Why attention was needed, one attention calculation done with real numbers, and how the parts fit together into a transformer block. (9 min)
  12. Chapter 7: How a language model writesA language model is a next-word chooser. See how it picks each word, what temperature does, and why it can only read so much at once. (6 min)
  13. Deep dive E: How a language model writes: the full pipelineLevel 2. Every stage from your question to the last word, with the numbers: tokens, scores, chances, sampling, the KV cache, and the speed-ups that make it fast. (10 min)
  14. Chapter 8: How a model is trained, and how to talk to itThe four stages from a model that has read a library to a helpful assistant, the difference between training and using, and the basics of writing a good prompt. (6 min)
  15. Chapter 9: What AI gets wrong, and whyMade-up answers, old facts, changing answers, tricks and unfairness: the weak spots of AI in plain words, and the usual fix for each. (6 min)
  16. Chapter 10: RAG: giving the AI a libraryHow an AI can look things up before it answers, so its replies are fresher, specific to you and easy to check. (6 min)
  17. Chapter 11: Agents and tools: AI that can actHow an AI goes from answering questions to doing jobs, using tools in a loop, and why the more it can do, the more careful the limits must be. (7 min)
  18. Chapter 12: Putting it all togetherOne request followed through a careful AI system, nine steps, and a guide to what to read next in the main book and the Journal. (5 min)
  19. Glossary: Every word in one placeEvery technical word in this book, in plain language, in alphabetical order, with the chapter where it is explained. (7 min)
Free to read, no sign-in. Written in the author's own words with invented examples. Disclaimers. Spotted a mistake or something unclear? Use the contact form on the home page.