← Back to top
A Thin Book on AI Agents
Book

A Thin Book on AI Agents

A technical book that demystifies AI agents with minimal code. Built on the insight that "the loop is simple — the hard part is handling data," it guides you through practical agent development.

What you'll learn

🔄

Agent Loop

Starting from a 14-line LLM call, build a complete agent in 72 lines. Understand the essence of the loop with minimal code.

🛠️

Mini-SWE-agent

Analyze the code of a practical agent that achieved 74%+ on SWE-bench. The same core loop is used in production systems.

🌳

PageIndex (RAG)

A tree-structured RAG system that doesn't rely on vector search. Includes a case study using Toyota's earnings report.

📖

Bonus Tracks

Source code analysis of Gemini CLI, Codex CLI, and OpenClaw. A deep dive into the design of real-world agents.

Table of Contents

  1. Agent Loop — From 14 Lines to 72
  2. Mini-SWE-agent — Anatomy of a Practical Agent
  3. Why Build Your Own Agent — Data Strategy
  4. Bonus: Reading the Gemini CLI Source
  5. Bonus: Reading the Codex CLI Source
  6. Bonus: PageIndex Implementation Guide

Tech Stack

  • Python
  • Gemini API
  • Tool Calling
  • Agent Loop
  • RAG
  • LuaLaTeX