Building AI Agents
from Scratch

A hands-on guide to building a fully functional CLI AI agent with tool calling, streaming, evaluations, context management, and human-in-the-loop safety. Available in five languages — plus a vibe-coding edition for product roles.

TS
TypeScript

TypeScript Edition

Built with the Vercel AI SDK, Zod schemas, and React + Ink for the terminal UI. The most framework-rich approach.

10 chapters
PY
Python

Python Edition

Uses the OpenAI SDK, dataclasses, and Rich + Prompt Toolkit for UI. The most approachable path to understanding agents.

10 chapters
RS
Rust

Rust Edition

Raw HTTP with reqwest. Manual SSE parsing. Trait objects for tool dispatch. Ratatui for terminal UI. No SDK, full control.

10 chapters + 5 appendices
GO
Go

Go Edition

Standard library net/http. Goroutines and channels for the agent loop. Bubble Tea for terminal UI. Single static binary, no framework.

10 chapters
JV
Java 21

Java Edition

java.net.http.HttpClient with Jackson. Sealed types and records. Virtual threads for concurrency. Lanterna for terminal UI.

10 chapters
VC
Vibe Coding

Vibe Coding Edition

For product managers, owners, and analysts. Build the same Python agent by guiding a coding agent through prompts — no programming required.

Chapters 0-3 available

What You'll Build