A Full AI Agent Engineering Book, with 28 Runnable Projects, Is Now Open-Source
Li Bojie's "Understanding AI Agents: Design Principles and Engineering Practice" is now fully open-sourced
The full book text, PDF, and accompanying code for 10 chapters have been released, centered around one core formula:
Agent = LLM + Context + Tools
📖 Read online: AgentBook
💻 GitHub: https://github.com/bojieli/ai-agent-book
Who is this book for?
- Developers who want to systematically understand Agent engineering (not just API calling)
- Engineers who need to build production systems like Coding Agents, RAG, and multi-Agent collaboration
- Researchers interested in underlying mechanisms such as context engineering, KV Cache, and tool design
Content Overview (10 Chapters / 28 Runnable Projects)
| Chapter | Topic | Highlight Projects |
|---|---|---|
| Chapter 1 | Agent Basics | Context ablation experiments, RL vs LLM sample efficiency comparison |
| Chapter 2 | Context Engineering | KV Cache-friendly design, 0.6B small model tool calling, prompt injection attack and defense |
| Chapter 3 | Memory and Knowledge Base | Hybrid retrieval pipeline, Agentic RAG, GraphRAG, context-aware retrieval |
| Chapter 4 | Tools | Three types of MCP servers (perception/execution/collaboration), event-driven asynchronous Agent |
| Chapter 5 | Coding Agent | 17-tool production-grade coding assistant, NL→SQL, paper→PPT→video |
| Chapter 6 | Evaluation | Terminal-Bench, SWE-bench, GAIA, cost breakdown, TTS quality evaluation |
| Chapter 7 | Post-training | SFT vs RL comparison, adaptive reasoning depth, tool-augmented mathematical reasoning |
| Chapter 8 | Self-evolution | Experience learning loop, workflow recording→toolification, proactive tool discovery |
| Chapter 9 | Multimodal and Real-time Interaction | Real-time voice dialogue, end-to-end vs cascaded voice, Computer Use |
| Chapter 10 | Multi-Agent Collaboration | Dual Agent phone+browser parallelism, voice Werewolf game, parallel search coordination |
Several noteworthy design choices:
- Small model validation: Chapter 2 uses a 0.6B local model to demonstrate complete tool calling, showing that system design matters more than model scale
- Ablation-driven: Multiple projects use controlled experiments (e.g., removing context components one by one), with quantifiable differences in effect
- Production-oriented: The Coding Agent is implemented in pure Python with no command-line dependencies; MCP servers include LLM secondary approval and sandbox isolation
- Code as meta-capability: Chapter 5 runs through the idea that "code can create new tools," from mathematical problem-solving to log self-healing parsing
API Key Reference (choose by scenario)
| Platform | Applicable Scenario |
|---|---|
| Kimi (Moonshot AI) | Long context, Agent tool calling |
| Zhipu GLM | Chinese tasks, cost-effectiveness |
| Siliconflow | Open-source models (DeepSeek, Qwen, Kimi K2, etc.) |
| Volcengine | Doubao series, low latency within China |
| OpenRouter | Unified interface to access Claude, Gemini, GPT, and other overseas models |
For model selection and API configuration details, see: https://01.me/2025/07/llm-api-setup/