How to learn "In-depth Understanding of AI Agent": 10 chapters of open source textbooks and 88 experiment guides

bojieli/ai-agent-book has open sourced the full text, PDF, EPUB and 88 supporting experiments of "In-depth Understanding of AI Agent: Design Principles and Engineering Practice". This article organizes the chapter structure, reading route, experimental reproduction and usage notes.

bojieli/ai-agent-book is the main repository of the open source textbook “In-depth Understanding of AI Agent: Design Principles and Engineering Practice” written by Li Bojie. The project discloses the full text of the book, PDF, EPUB, illustrations and code experiments organized by chapters. It uses 10 chapters to connect Agent foundation, context, memory, tools, Coding Agent, evaluation, training, self-evolution, multi-modality and multi-Agent collaboration.

The entire book uses an easy-to-understand formula:

1
Agent = LLM + 上下文 + 工具

This book is suitable for people who can already call large models but want to understand the Agent engineering system. Rather than just introducing a few frameworks, it puts Harness, context management, tool invocation, evaluation, and practical code beyond the model into the same learning path.

Quick conclusion

  • The Chinese text, PDF and EPUB of the entire book can be read for free, and the warehouse uses Apache License 2.0.
  • There are 10 chapters in total and 88 projects, more than 70 of which can be run independently.
  • The main text is mainly in Chinese, with Taiwanese traditional, English, Tamil and Vietnamese community translations available.
  • The community translation may lag behind the original Chinese version. If you are interested in the latest content, you should check book/ first.
  • Some experiments require API Keys, GPUs, external data sets, browser environments, or robot hardware. It cannot be assumed that all experiments can be run directly on an ordinary laptop.

Where to read and download

Project homepage:

https://github.com/bojieli/ai-agent-book

The warehouse README provides the latest build links for Chinese PDF and EPUB, and you can also read the Markdown source text directly on GitHub. The Chinese text is mainly located at:

1
2
3
4
5
6
book/introduction.md
book/chapter1.md
book/chapter2.md
...
book/chapter10.md
book/afterword.md

Multilingual catalog includes:

1
2
3
4
book-zhtw/
book-en/
book-ta/
book-vi/

If you are just reading, it is more stable to directly download the fixed version in Release; if you want to track the latest revision, you can read the PDF, EPUB or book/ source text generated by the main branch. The fixed version is easy to reference and take notes, and the main branch may continue to add errata and new content.

What does Chapter 10 talk about?

Chapter Topic Learning Points
Chapter 1 Agent basics Agent definition, model capabilities and Harness engineering
Chapter 2 Context Engineering KV Cache, Hint Engineering, Agent Skills, Context Compression
Chapter 3 User memory and knowledge base Cross-session memory, RAG, structured indexing and knowledge graphs
Chapter 4 Tools MCP, awareness/execution/collaboration tools, asynchronous agents and tool discovery
Chapter 5 Coding Agents and Code Generation Components and Workflows of Production-Grade Coding Agents
Chapter 6 Agent Assessment Environment, Metrics, Statistical Significance, and Assessment-Driven Selection
Chapter 7 Post-model training Pre-training, SFT, RL, tool call internalization and sample efficiency
Chapter 8 Agent self-evolution Experience learning, Prompt distillation and tool creation
Chapter 9 Multimodal and real-time interaction Voice, Computer Use, GUIs, and Robots
Chapter 10 Multi-Agent collaboration Task division, context sharing and isolation, group behavior

If you are not familiar with Agent, MCP, RAG and Token, you can first read the [AI Agent, MCP, RAG and Token Glossary] (/en/2026/04/23/ai-terms-agent-mcp-rag-token-explained/) on the site. If the focus is on multi-Agent collaboration of Coding Agents, you can combine Claude Code Subagents and Agent Teams Comparison to understand the scheduling differences in actual tools.

Route 1: Product and Application Developer

Suggested order:

1
第 1 章 -> 第 2 章 -> 第 3 章 -> 第 4 章 -> 第 6 章

Understand the Agent structure first, then learn about context, memory, tools, and evaluation. Once completed, you should be able to determine whether problems with an Agent product stem from the model, context, tool interface, or lack of repeatable evaluation.

Route 2: AI programming tool developer

Suggested order:

1
第 1 章 -> 第 2 章 -> 第 4 章 -> 第 5 章 -> 第 6 章 -> 第 10 章

Focus on Coding Agent, tool execution, security boundaries, context compression, code evaluation and multi-Agent division of labor. When learning, don’t just look at the final demo. You should record how the Agent selects files, calls tools, handles failures, and verifies results.

Route 3: Model training and research direction

Suggested order:

1
第 1 章 -> 第 6 章 -> 第 7 章 -> 第 8 章 -> 第 9 章 -> 第 10 章

Establish evaluation awareness first, and then enter SFT, RL, self-evolution, multi-modality and multi-agent. This can avoid training the model first and then supplementing the indicators, resulting in incomparable experimental conclusions.

How should 88 experiments be run?

The warehouse provides code directories by chapters:

1
2
3
4
chapter1/
chapter2/
...
chapter10/

The status and dependencies of different experiments are not the same. Suggestions before you start:

  1. Read the text of the corresponding chapter first;
  2. Open the README in the chapter directory;
  3. Confirm whether the experiment mark is runnable, reproducible, or a design exercise;
  4. Check Python, Node.js, GPU, API Key and dataset requirements;
  5. Use an independent virtual environment to install dependencies;
  6. Run the smallest example first, and then change the model, data or tools;
  7. Save input, output, dependent versions and acceptance results.

You can clone the repository first:

1
2
git clone https://github.com/bojieli/ai-agent-book.git
cd ai-agent-book

Do not assume there is a unified installation command directly in the repository root directory. The 88 projects involve different frameworks and dependencies. You should enter the specific chapters and experimental directories and strictly follow the corresponding README operations.

Which experiments require additional resources

API Key

Some experiments require access to the large model API. The README lists options such as Kimi, GLM, SiliconFlow, Volcano Engine, and OpenRouter. Before use, please confirm:

  • Whether the region where the account is located is supported;
  • Whether the model name and interface are still valid;
  • Free quota, rate limit and billing method;
  • Do not submit API Key to Git;
  • Whether the sample output relies on specific model capabilities.

Don’t write the API Key directly into the Python file. Prioritize using environment variables or the .env method specified in the experimental README, and confirm that .env has been ignored by Git.

External warehouses and datasets

Some evaluation, training, browser and robot projects in Chapters 6, 7, 9 and 10 are not directly included in the main repository and need to be cloned separately. Examples currently listed in the README include:

  • android_world, GAIA, OSWorld, SWE-bench, tau2-bench, terminal-bench;
  • MiniMind, verl, SFTvsRL, Tinker Cookbook and other training programs;
  • browser-use and Anthropic claude-quickstarts;
  • TalkAct and Stanford Generative Agents.

If the experiment README specifies commit, the version should be switched as required. Directly using the latest main branch of the external repository may not be able to reproduce the results in the book due to changes in API, dependencies or directory structure.

GPU and real hardware

Training, large model inference, VLA, robotics, and Sim2Real experiments may require larger graphics memory or actual devices. Ordinary computers can first complete concepts, APIs, contexts, memories, MCPs, and lightweight evaluation experiments; do not purchase expensive hardware from the beginning in order to complete all chapters.

How to turn reading into real engineering skills

Each chapter can use the same set of learning loops:

  1. Write in one sentence the problem to be solved in this chapter;
  2. Draw the data flow of input, context, model, tool and output;
  3. Complete a minimal experiment;
  4. Actively cause a failure, such as tool timeout, context being too long, or return format error;
  5. Add logs, retries, permission restrictions or acceptance conditions;
  6. Use the fixed test set to compare the results before and after modification;
  7. Organize reusable rules into project documents or skills.

For example, when studying Chapter 4 MCP, you should not stop at “tool call was successful”, but also check parameter validation, timeouts, error recovery, and permission scope. When studying Chapter 6 Evaluation, don’t just look at the beautiful output once, but record samples, metrics, and repeated experiment results.

How to choose between PDF, EPUB and web page source code

Form Suitable for the scene Notes
PDF Continuous reading, printing, fixed page number citation The main branch construction will be updated, and it is recommended to use Release for formal citations
EPUB Reading on mobile phones, tablets, and electronic paper books Different readers have different support for code blocks and tables
GitHub Markdown View latest content, search, track changes Reading is not as consistent as e-books
Local source code Annotate, modify, and run supporting experiments Need to manage Git versions and dependencies by yourself

If you need to build the PDF yourself, the official instructions require pandoc, xelatex, ElegantBook document classes and related fonts, and then execute:

1
cd book && bash build_pdf.sh

This command is more suitable for users of Linux, macOS, or existing Bash/LaTeX environments. Windows users can use WSL, but they should first confirm the font and TeX dependencies, otherwise it may fail at the Chinese font or LaTeX package stage.

Common misunderstandings

I thought all 88 experiments could be run with one click

Different experiments cover API, RAG, training, browser, GUI, voice and robots, with a wide range of dependencies. The correct approach is to configure each chapter separately in the README instead of looking for a root directory full installation command.

Only download the PDF, do not look at the code version

The PDF is suitable for reading, but if the experiment fails, you should return to the corresponding chapter directory, check the README, dependent files, specified commits and Issues. The concepts and codes in the book evolve at different speeds, and a fixed version is easier to reproduce than blindly chasing the latest.

Run all external projects directly

External repositories can be large and may require datasets, GPUs, containers, or specific licenses. Clone only the projects you need for the current study chapter, reading the respective licenses and hardware requirements first.

Equate Agent as a large model

It is repeatedly emphasized throughout the book that Agent also includes context and tools. In actual systems, prompts, memory, permissions, execution environment, state persistence and evaluation often determine whether it can work stably. Larger models cannot automatically solve all engineering problems.

Which readers are it suitable for?

Suitable for:

  • I want the system to understand the AI Agent, rather than someone who can only call the framework;
  • Engineers who are developing coding agents, knowledge assistants or automated workflows;
  • Developers who want to complete their knowledge on context, memory, MCP, evaluation and post-training;
  • People who need course, book club or team training materials;
  • Learners who are willing to reproduce experiments and record the failure process.

If you’re just looking for quick installation commands for a framework, this book might seem long. You can read a chapter by topic first and then decide whether to complete the entire route.

Summary

bojieli/ai-agent-book explains AI Agent from concepts, contexts and tools to evaluation, training, multi-modality and multi-Agent collaboration, and provides a large number of supporting experiments. It is better suited as a study plan lasting several weeks rather than as an introduction to a project that can be read in one day.

It is recommended to choose chapters based on your own goals, complete a minimum experiment first, and then gradually add models, tools, memory, and evaluation. As long as “understanding a chapter” can be transformed into “running through, making failures, repairing and accepting an experiment”, this set of open source textbooks can truly enter engineering practice.

Project address: bojieli/ai-agent-book