hahhforest/pi-textbook

《动手学 Pi》:沿 15 个真实 checkpoint 从零构建 Pi-style Agent

What it solves

This project provides a hands-on, step-by-step educational path for developers to build a functional Pi-style coding agent from scratch. It bridges the gap between theoretical agent concepts and real-world implementation by using a series of 15 verifiable code checkpoints.

How it works

The curriculum is organized into 15 Git-based checkpoints that evolve a simple offline trace into a fully operational coding agent. Each chapter consists of four integrated components: explanatory text, actual Git commits, focused unit tests, and troubleshooting experiments. Learners progress through the architecture by implementing TypeScript protocols, streaming models, tool registries, agent loops, session management, and evaluation frameworks.

Who it’s for

This course is designed for developers who want to understand the internal mechanics of coding agents. It is ideal for those who prefer learning through code history, testing, and hands-on experimentation rather than reading abstract documentation.

Highlights

  • 15 progressive checkpoints covering the full lifecycle of an agent (from protocol definition to evaluation).
  • Real, runnable code history that can be checked out and verified via Git.
  • Integrated "practice" mode that allows users to work on exercises without seeing the final implementation.
  • Comprehensive coverage of essential agent topics including context compaction, session trees, and tool-use contracts.

Related

  • Project
  • Project
  • Project
  • Project