Zeitgeist
Pi began in August 2025 as a monorepo with an ambitious scope: not just another coding agent, but an entire toolkit for building AI-powered developer tools. Mario Zechner set up npm workspaces on day one with four packages — pi-ai (a unified LLM API), pi-agent-core (an agent runtime), pi-tui (a custom terminal UI library), and pi-coding-agent (the interactive CLI). Later came pi-web-ui, pi-mom (a Slack bot), and pi-pods (GPU deployment tooling). The decision to build all of these in one repo, from scratch, rather than assembling existing libraries reveals the core philosophy: full-stack control over the agent experience, from the raw LLM API calls up to the pixel-level terminal rendering.
The most striking early decision was building a custom TUI library (pi-tui) with "surgical differential rendering" — a system that tracks which terminal cells actually changed and only redraws those, preserving the user's scrollback buffer. Most coding agents at this point simply dumped text to stdout. Pi wanted to be a real application with a proper UI, not a script. The TUI renders markdown, handles emoji wrapping edge cases, and supports theming — all from scratch, within the first two weeks.
The other foundational bet was the unified provider API in pi-ai. Rather than binding to one LLM vendor, pi abstracts OpenAI, Anthropic, and Google behind a single streaming interface (AsyncGenerator<StreamEvent>). This wasn't just about flexibility — it was about making the agent runtime provider-agnostic, so the same session could be replayed against different models. Reasoning token support was added across all providers immediately, including partial JSON parsing for streaming tool calls — infrastructure that would become critical as thinking-capable models became the norm.
Key Developments
The Unified LLM Provider Interface
The LLMProvider interface in packages/ai/src/ abstracts chat completions into a single streaming protocol. Each provider (OpenAI, Anthropic, Google) implements the same chat() method returning AsyncGenerator<StreamEvent>. This means the agent runtime never thinks about which model it's talking to — it just processes a stream. The design included Unicode surrogate sanitization across all providers from the start, suggesting experience with production edge cases.
Surgical Differential Rendering (pi-tui)
Rather than using an existing terminal UI library like Ink or Blessed, pi built pi-tui with a differential rendering engine inspired by React's virtual DOM, but for terminal cells. The Container component tracks child changes, and the renderer only sends ANSI escape codes for cells that actually differ from the previous frame. This preserves the terminal scrollback buffer — a detail that matters enormously for a tool you use inside tmux or a terminal multiplexer.
The Agent Runtime Loop
packages/agent/src/ implements the core agent loop: accept a user message, call the LLM, parse tool calls from the streaming response, execute tools, and loop. Tool calls are extracted from streaming JSON (via a custom partial JSON parser) so the agent can begin preparing before the model finishes generating. The runtime handles abort signals, thinking traces, and stop reasons as first-class concepts.
Mom: The Slack Bot
One of the more surprising early additions was pi-mom — a Slack bot that delegates messages to the coding agent running in a Docker sandbox. Mom got working memory (cross-session context), centralized logging, and usage tracking within the first few weeks. This reveals an early vision for pi as not just a CLI tool but a platform — the same agent runtime can power interactive terminals, Slack bots, or web interfaces.
Web UI Components
The pi-web-ui package provided Lit-based web components for AI chat interfaces, including artifact rendering (with auto-reload when dependencies change), collapsible tool renderers, and session persistence via IndexedDB. A browser extension prototype for an "AI reading assistant" appeared and was abandoned — but the web components survived and evolved into a real alternative interface.
Pi launched with exactly four tools: read, write, edit, and bash. These remain the core tools through v0.66. The tool system was designed around the AgentTool interface with typed inputs and results, custom rendering (ToolRenderResult), and an onCompleted callback for guaranteed delivery. The bash tool notably supported timeout handling and working directory tracking from the start.
Session Management Basics
Even in this foundational stage, sessions were persistent — saved as JSONL files with full message history, model state, and thinking traces. The --resume flag with a session selector appeared early, along with model cycling (switching models mid-conversation) and thinking level controls.
Philosophy Shifts
The README at this stage described pi simply as "A collection of tools for managing LLM deployments and building AI agents." No AGENTS.md existed yet — the project's development conventions were implicit, not codified. The lack of formal rules reflects a single-developer project moving fast.
The most revealing philosophy is in what pi didn't do: it didn't use LangChain, didn't use an existing TUI library, didn't abstract away the streaming protocol. Every layer was built from scratch with specific opinions about how an agent should work. The presence of pi-pods (vLLM deployment tooling) alongside the coding agent suggests the author was thinking about the full lifecycle: deploy your own models, build agents that use them, run those agents everywhere.
Looking Forward
Several seeds planted here bloom in later stages: the ToolRenderResult interface foreshadows the extension system's custom renderers. The provider abstraction enables the model catalog and auto-detection that come in the Provider Ecosystem stage. The session JSONL format becomes the foundation for branching, forking, and the session tree. And the Slack bot's "delegate to a subprocess" pattern eventually inspires how extensions and sub-agents work. The missing piece is extensibility — at this point, all tools and behaviors are hardcoded. That changes dramatically starting in Stage 5.