AgentIndex icon
AgentIndex
ToolsMCP ServersHOTCategoriesTrendingNewBest ListsCompareGuides
Submit Tool
ToolsMCP ServersHOTCategoriesTrendingNewBest ListsCompareGuides
Home/
Code Assistant/
pi-from-scratch
pi-from-scratch logo

pi-from-scratch

Active·★ 1.3k·MIT·Updated 2026-10-24

PI from Scratch is a Chinese-language article, not a framework. It follows the data flow of the pi coding agent and rebuilds a stripped-down version called nano-pi that can read files, edit code and run commands, keeping pi's core ideas and dropping its engineering detail.

The companion website pairs the article with the source: as you read, an editor on the right fills in the code until the whole of nano-pi is on screen. A trace feature lets you set breakpoints and step through the execution line by line; the online trace is pre-generated, so browsing the site makes no model requests. The author notes the article is written by hand.

To run nano-pi yourself you need Node.js 22+ and an OpenAI-compatible API, configured with NANOPI_API_KEY and optionally NANOPI_MODEL and NANOPI_BASE_URL. The website can also run locally from the web folder. The project is MIT-licensed.

This write-up is based on the project's README and public repository data. We have not hand-tested the tool. Data as of 2026-10-25.

License
MIT
Latest release
No GitHub releases
Last commit
2026-10-24
Contributors
6
Forks
106
Open issues and PRs
0
First published
2026-08-09

Source: GitHub, npm and PyPI public APIs.

#coding-agent#tutorial#typescript#agent-loop#pi-agent#llm
$ Install
$ npm install && npm run dev
↗ Visit site★ GitHub
01

Features

01Step-by-step article that builds a working coding agent from zero
02Website shows code completing in an editor as you read
03Trace view to step through the agent's execution line by line
04nano-pi runs against any OpenAI-compatible API
02

Why choose it

+Code appears in the editor alongside the text, so you see each piece as it is explained.
+A step-through trace shows how the agent loop actually executes.
+Small enough to read in one sitting and run against any OpenAI-compatible API.
03

Trade-offs

!The article is written in Chinese.
!nano-pi is a teaching build, not a replacement for pi in daily work.
!Needs your own OpenAI-compatible API key to run locally.
04

Maintenance check

ActiveChecked: 2026-10-25
Last commit
2026-10-24
Commits, last 90 days
23
Releases, last 90 days
0
Latest release
—
Open issues
0
Recent issues with at least one comment
2/4
Commits per week, last 12 weeks
Commits per week, last 12 weeks: 19, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0

Oldest week on the left; the latest four weeks are orange. Source: GitHub commit activity.

Status rule: archived on GitHub = Archived; last commit within 90 days = Active; 91 to 365 days = Slowing; older = Stale. All figures come from the GitHub API on the date shown.

05

Compatibility

Node.js 22+
Runtime
Verified via docs
OpenAI-compatible APIs
Model endpoint
Verified via docs
06

Quick start

1
$ npm install
2
$ npm run dev
07

Use cases

↳Learn how a coding agent's tool loop works internally
↳Use nano-pi as a small base for your own agent experiments
↳Prepare to read the full pi codebase
08

Alternatives

⚡Top VS:
VSpi-mcp-adapter★1.6k→VSContext7★63.8k→VSOpen Interpreter★68.7k→VSCodewhale★41.1k→
pi-mcp-adapter logo
pi-mcp-adapter★ 1.6k
Token-efficient MCP adapter for Pi coding agent
VSCompare→
Context7 logo
Context7★ 63.8k
MCP Server that provides up-to-date code documentation for LLMs and AI code editors.
VSCompare→
Open Interpreter logo
Open Interpreter★ 68.7k
A coding agent for the terminal, optimized for low-cost and open models. Forked from OpenAI's Codex, it can emulate other agent harnesses and runs commands in a native sandbox.
VSCompare→
Codewhale logo
Codewhale★ 41.1k
Open-source agent for the terminal written in Rust. Use any provider or model. Issues & PRs always welcome
VSCompare→
oh-my-pi logo
oh-my-pi★ 36.8k
⌥ Coding agent with the IDE wired in. Built by Stencil Labs.
VSCompare→
qwen-code logo
qwen-code★ 28.8k
An open-source AI coding agent that lives in your terminal.
VSCompare→
PocketFlow-Tutorial-Codebase-Knowledge logo
PocketFlow-Tutorial-Codebase-Knowledge★ 12.7k
Pocket Flow: Codebase to Tutorial
VSCompare→
jcode logo
jcode★ 21.3k
High performance coding agent harness written in Rust, built for heavy multi-agent dev workflows
VSCompare→
See all alternatives →

Comments

Log in to leave a comment

No comments yet. Be the first!

On this page
01Features02Why choose it03Trade-offs04Maintenance check05Compatibility06Quick start07Use cases08Alternatives
SaladDay /
pi-from-scratch
↗

A Chinese walkthrough that builds a minimal pi-style coding agent in about 600 lines of TypeScript

1.3k106MIT
Last commit4d ago
StatusActive
CategoryCode Assistant
Contributors6
Links
Documentation↗Discussion↗Issues↗Releases↗
Cloud Infrastructure
Ad

Deploy on DigitalOcean

Host your MCP servers, Docker containers, and AI agents with $200 free credit over 60 days.

Claim $200 Free Credit
© 2026 AgentIndex.app|Built by a 10-year iOS Developer.
Best by use caseAboutContactAdvertisePrivacy PolicyTerms of UseQYSGitHubBuy me a coffee ☕

Browse by Category

MCP ServersCode AssistantWorkflow AutomationRAG / Knowledge BaseMulti-AgentBrowser AutomationLLM InfraDev ToolingObservability

Not affiliated with Anthropic, OpenAI or Microsoft.