Learn it.
Practice it.
Achieve Mastery.

How AI works, from linear algebra and gradient descent to transformers, RAG, and agents. Each idea is explained step by step, and most come with a Python problem you solve in the browser and check against test cases.

254 pages and 243 practice problems.

Attention step 1/4

Tokens attend to tokens

Q · Kᵀ / √d → softmax → weighted values, computed in the page.
Open lesson →
01tokens
02Q K V
03scores
04attention
modelslearnrelationships
models32%
learn38%
relationships30%

Q · Kᵀ / √d scores normalized with softmax

Read it, poke at it, then write it.

  1. An explanation that starts from what you already know and says where the idea breaks down.
  2. Where it helps, a diagram or widget you can change and watch the numbers move.
  3. A practice problem: write the function yourself and run it against the tests.

The control loop of a graph-based agent. Interactive version

InputRouter / PlannerAgent (tools)Agent (search)Agent (code)State UpdateOutput