# hahhforest/pi-textbook

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

Repository: https://github.com/hahhforest/pi-textbook
Canonical: https://ross.abutalabs.com/products/pi-textbook
Homepage: https://build-your-own-pi-cn.enochzhang.chatgpt.site
Language: TypeScript
License: MIT
License Family: permissive
Topics: agent-engineering, ai-agent, chinese, llm, textbook, typescript
Last push: 2026-07-23T03:35:41+00:00

## Health v2 (maintenance only)
Score: 55/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 94, release rhythm 35, longevity 3
- inputs: {"age_days": 43, "days_push": 41, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, young
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1267, forks 76 (observed 2026-08-28T04:04:11.224909+00:00)

## What it is
An open-source Chinese-language textbook ('动手学 Pi' / Build Your Own Pi) that teaches agent engineering by building a Pi-style coding agent in TypeScript across 15 runnable checkpoints. Each chapter pairs textbook prose with real commits, focused tests, and fault-injection experiments along a single evolving codebase.

## Use cases
- learn how to build an LLM coding agent from scratch
- understand agent loop and tool calling internals
- study streaming model provider integration in TypeScript
- learn session persistence and context compaction for agents
- hands-on tutorial for building AI agents with real commits and tests
- learn TypeScript event streaming and protocol design
- understand how coding agents execute file and bash tools

## When to choose
- you want a structured, test-verified path to understanding agent internals rather than a finished product
- you prefer learning by rebuilding a system incrementally with real git history
- you read Chinese (or English) and want a D2L-style short feedback loop for agent engineering

## When to avoid
- you need a production-ready agent framework to use directly rather than a teaching codebase
- you want a quick reference or source-code tour instead of a multi-week course
- you need agent features beyond the teaching scope, such as built-in permission confirmation or cwd jail

## Facets
- artifact type: learning-resource
- maturity: active
- function: agent-framework, llm-inference, developer-tools, testing
- domain: large-language-models, tutorials, education, developer-tools
- platform: cli
- tags: build-your-own, agent-engineering, chinese-language, textbook, checkpoints, hands-on-learning, coding-agent, ai-agents, typescript, nodejs

## Member repositories
- hahhforest/pi-textbook (main) score 55

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:11.224909+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T05:03:42.486733+00:00, confidence not recorded.
  - readme: https://github.com/hahhforest/pi-textbook (fetched 2026-08-28T04:04:11.224909+00:00, sha 235a7ce73c1d)
  - homepage: https://build-your-own-pi-cn.enochzhang.chatgpt.site (fetched 2026-08-29T12:15:33.039407+00:00, sha 4c2cbf9ab0b8)
  - site_page: https://build-your-own-pi-cn.enochzhang.chatgpt.site/about (fetched 2026-08-29T12:15:33.042455+00:00, sha 652d91b5cfe6)
- Data as of 2026-08-30T08:39:29.467469+00:00.
