Skip to content

For developers, engineers and project managers

Learn how AI works by operating it

Free interactive notes. Roll the dice a model rolls, train a tiny network in your browser, then finish by building a working agent harness on one page of Python.

Start with part 1

17 notes · 81 interactive figures · 17 quizzes · free, no account

harness.py running

step 1 of 6

Model

Harness

Tools

messages: 1 item

messages

  1. userWhat is invoice 4417 in euros?

The harness starts a list with your question and sends the whole list to the model.

One real run of the loop that powers every agent. Pause it, or jump to any step.

The problem with AI explainers

Diagrams don't teach. Hands do.

You have read the explainers. You can say "attention" in a meeting. Ask how a model picks its next word and the picture goes soft. These notes make you do the thing, so the idea has somewhere to land.

A typical explainer

  • A transformer diagram you nod at and forget by Thursday
  • Jargon parked in a glossary you never open
  • A demo you have to take on trust
  • Stops where the theory stops

A note here

  • Roll the next token dice yourself and see why a model remembers nothing
  • Hover any term for a plain definition, right where you meet it
  • Predict what will happen before you press the button
  • Finish with a harness you could run tomorrow

Poke every part of the machine until none of it feels like magic. Then write the loop that runs it.

What you get

Understanding that survives the next meeting

Operate it, don't just read it

Roll the dice a model rolls, train a tokenizer, tune a LoRA adapter, poison an MCP tool. 81 interactive figures across the series, each one built to be pushed until it breaks.

The capital of France is…

  • Paris87.4%
  • a4.1%
  • the2.6%
  • located1.9%

Learn in the order it builds

Sixteen parts, each leaning only on the ones before it. Tokens, weights, attention, training, retrieval, tools, agents.

Make better calls at work

Know why long chats cost more, what fits on one GPU, and when to retrieve instead of finetune, before the planning meeting.

Find your gaps early

Every part ends with a short quiz. Predict, answer, and see what you really understood. 17 quizzes in all.

Finish by building one

The last lecture takes a harness apart line by line, then builds a working one on a single page of Python.

The series

Sixteen notes that build on each other

About 6 hours of reading and playing in all. Each part stands on the one before it, and you can stop and pick it up next week.

Start with part 1
The capstone lecture · 16 minThe harness, as Feynman might have taught itPlay the harness by hand, take one apart, then build a real one.

How it works

Three moves, repeated sixteen times

  1. 01

    Start with one question

    Each note opens with a plain question, like why a model remembers nothing. The only prerequisite is the part before it.

  2. 02

    Operate the figure

    Drag, roll, train, break. The note asks you to predict first, so you notice exactly where your picture was wrong.

  3. 03

    Check yourself, then continue

    A short quiz closes every part and points to the next. Stop anywhere and pick it up later.

Where it ends

Finish by writing the loop yourself

The smart part you rent by the word. What you build is the dumbest program you have ever written: send the list to the model, run what it asks for, write the result down, go around again. Sixteen lines, and every agent runs on it.

  • Play the harness by hand before you read any code
  • Remove one line at a time and predict what breaks
  • Then build a real one that reads your files
Read the harness lecture

harness.py

def harness(task):
    messages = [user(task)]              # the list starts with the question
    for step in range(MAX_STEPS):        # around and around...
        reply = model(messages, tools=TOOLS)   # send the whole list
        messages.append(reply)           # write its reply down
        if reply.stop_reason != "tool_use":    # no request? it's finished:
            return reply.text            #   give the text to the user
        results = []
        for call in reply.tool_calls:    # it asked for something:
            try:
                out = TOOLS[call.name](**call.input)   # run it
            except Exception as e:
                out = error(e)           # an error is just another result
            results.append(tool_result(call.id, out))
        messages.append(results)         # write the results down
    raise RuntimeError("step limit")     # ...but not forever

Questions

What people ask before they start

Yes. Every note is free to read, there is no account to make, and nothing sits behind an email form.

Most stop at a diagram. Here every concept has figures you operate, and you are asked to predict the result first, so you find the gaps in your own picture instead of nodding along.

It is built to end in practice. The tradeoffs that show up in real projects, like cost, hardware limits and tool security, each get their own part, and the final lecture builds a working agent harness on a page of Python.

Yes. Parts 1, 7, 10, 12, 13 and 15 are the ones that change decisions: why long chats cost more, when to retrieve instead of finetune, what fits on which hardware, and where security has to live when a model calls tools. You can skip the code and still follow every figure.

No. The figures do the arithmetic and show the maths with numbers you can change. The harness lecture has Python, short enough to read even if you never write it.

Start at part 1 if you are new, or jump to the harness lecture if you already know what tool calling is. Each part takes about 20 minutes to read, longer if you play with every figure. The whole series is roughly 6 hours.

Subscribe to the RSS feed at adamnotes.com/rss.xml with any feed reader. No email address needed.

Start with part 1. Stop whenever you like.

About 20 minutes gets you through the first note. By the end of it you will know why a model remembers nothing, and you will have rolled the dice yourself.

  • Free to read, with no account
  • No email wall in the way
  • Nothing to cancel, leave any time