How AI Agents WorkCourse map

An interactive course on agent architecture

How AI Agents Work

An agent is not a mind that thinks all the time. It is a loop of ordinary code that calls a model, runs what the model asks for, and repeats. Every advanced idea in this course is something added to that loop.

The one loop behind every agent

  1. State: what your code holds
  2. Build context: choose what the model will see
  3. Call model: one computation, nothing remembered
  4. Model decides: an answer or a requested action
  5. Runtime acts: check the request, then run it
  6. Update state: record the result, then repeat

Two of the six steps belong to the model. The other four are code you own. Each chapter opens with this map and shows which step it extends.

Colors mean roles

Every diagram and widget uses the same colors, always with a label.

  • Model The model: one call, context in, response out.
  • Your code The runtime: the loop, the rules, and running tools.
  • Tool Tools and the outside world.
  • State State, memory, and storage.
  • Context What the model sees in one call.
  • Human A person: user, approver, reviewer.

What you will be able to do

By the end, you should be able to ask an AI coding system for something like this, and know exactly what you asked for:

"Build an agent with isolated subagents, durable task state, filesystem tools, human approval for dangerous actions, context compaction, and persistent project memory."

You will know what each phrase means, why you might want it, the alternatives, and what can go wrong. Chapter 21 decodes the sentence term by term.

How to use this course

Progress, ticks, and your exercise notes are saved in this browser only. Nothing is sent anywhere.

Course map

Start hereWhat separates a model from an agent.

The core loopThe loop, its tools, its state, and what the model sees.

Capabilities built on the loopMemory, planning, subagents, skills, and coding agents.

Control and safetyWhat the agent can touch, and when a person decides.

SystemsLong-running work, communication, and architecture.

QualityHow agents fail and how to measure them.

Real systemsHermes, Deep Agents, Pi, and others as case studies.

Thinking like a designerAttribute gains, own the decisions, practice designs.

ReferenceSelf-test and glossary.