Inside Pi

18 chapters · ~4 hours · by Ruan Engelbrecht

Inside Pi

A Course on Coding Agents and Durable Execution

How a modern AI coding agent works, from the bytes on the wire to a crash-proof runtime, taught by reading the earendil-works/pi monorepo end to end.

Part I

Foundations

What is an agent, and how is this repository built?

Part II

pi-ai

How do many incompatible model APIs become one event stream, and how are models and credentials managed?

Part III

Agent core

How does the loop run tools, take steering, cancel, retry, and serve terminals, scripts and other programs?

Part IV

Coding agent

How do the tools, sessions, extensions and the interactive app work?

Part V

pi-tui

How do you draw a fast, correct UI with escape sequences?

Part VI

pi-durable

How do you make an agent survive crashes, and run its tools on other machines?

Part VII

Supporting libraries

How do replicated state, hot reload, sandboxes, MCP, telemetry and evals work?

Appendices

Appendices

Every CS concept by field; a reading path, projects and further reading.