pi from scratch is an open-source educational TypeScript project that provides a minimal implementation for building a personal AI assistant (pi-agent) from the ground up. The project serves as a learning resource for developers interested in understanding the fundamental components and architecture required to create a functional AI assistant. It demonstrates core concepts through concise, well-documented code rather than aiming for production-level features.
What it is
pi from scratch is a lightweight codebase written in TypeScript, consisting of approximately 600 lines of code. The project is designed as an educational tool to help developers understand how to construct a basic AI assistant system from first principles. It provides a simplified but functional implementation that covers essential components such as API integration, conversation handling, and response generation.

The implementation focuses on clarity and learning value rather than complex production features. Developers can study the code structure, modify components, and extend functionality to create their own customized pi-agent implementations. The project serves as a practical starting point for those wanting to explore AI assistant architecture without the overhead of large frameworks.
Key facts
| Attribute | Value |
|———–|——-|
| Developer | SaladDay |
| License | MIT |
| Language | TypeScript |
| Availability | GitHub: SaladDay/pi-from-scratch |
How it compares
pi from scratch differs from production-ready AI assistant frameworks like LangChain or Microsoft’s Semantic Kernel by focusing exclusively on educational minimalism rather than enterprise features. Unlike comprehensive SDKs that offer extensive tooling, integrations, and scalability, this project demonstrates the bare essentials required to build a functioning AI agent. It serves as a learning companion to larger frameworks rather than a competitor, helping developers understand the underlying concepts before working with more complex systems.
FAQ
What prerequisites are needed to run pi from scratch?
The project requires Node.js and npm for installation, along with an API key from a compatible AI service (referred to as NANOPI_API_KEY in the documentation). The setup process involves standard npm installation commands followed by environment variable configuration.
Is pi from scratch suitable for production use?
No, pi from scratch is explicitly designed as an educational resource rather than a production-ready framework. It provides a minimal implementation for learning purposes and would require significant expansion and hardening for commercial deployment.
What makes this project different from other AI assistant tutorials?
Unlike many tutorial projects that focus on specific aspects or use high-level abstractions, pi from scratch aims to provide a complete, from-the-ground-up implementation in a single concise codebase. The approximately 600 lines of TypeScript offer a self-contained learning experience for understanding AI assistant architecture fundamentals.
