# Dive into Pi

A Chinese-language course that has the reader build a Pi-style coding agent from scratch across 15 runnable checkpoints, each pairing course text with a real commit, a focused test and a failure experiment.

This project is a Chinese-language hands-on course that builds a Pi-style coding agent from an offline execution trace across 15 runnable checkpoints. Each chapter combines course text, a real commit, a focused test and a failure experiment, so the course code is a runnable, checkable Git history rather than pseudocode.

The checkpoints progress from a TypeScript message and model protocol through streaming model calls, a provider API, tool calling and an agent loop, to session-tree history, context compaction, extension points such as trusted hooks and templates, and a final independent evaluation harness for the completed agent. Readers can follow along on the accompanying website or clone the repository and run it locally with Node.js.

Website: https://build-your-own-pi-cn.enochzhang.chatgpt.site
