Home

A book for Python engineers who want to understand the loop around the model.

Building an AI Agent Harness from Scratch

A book for Python engineers who want to understand — not just use — the loop around the model.

Twenty-two chapters. Cumulative build. Provider-agnostic from the first loop. By the end, you have a working harness with compaction, sub-agents, permissions, MCP, observability, evals, cost control, and durable checkpointing — and the judgment to extend it.

How to read this

Two modes, both supported:

  • Linear — start at Chapter 1, type every line, commit at each chapter tag.
  • Reference — jump to the subsystem you need. Each chapter opens with a "Previously…" and closes with a "What you now understand."

Open the sidebar and dive in.