Open-Source AI Agent Book: 10 Chapters, 103 Runnable Experiments
This article reviews an open-source book 'Deep Understanding of AI Agent' that structures AI Agent engineering around the formula Agent = LLM + Context + Tools, offering 10 chapters and 103 runnable Python experiments covering context engineering, memory, tool use, multi-agent collaboration, and model post-training.
The article introduces an open-source book titled Deep Understanding of AI Agent: Design Principles and Engineering Practice (《深入理解 AI Agent:设计原理与工程实践》) authored by Li Bojie, an engineer with years of AI Agent experience. The book is hosted on GitHub at bojieli/ai-agent-book with 39k+ stars, written in Python, and licensed under Apache-2.0.
Core Formula: Agent = LLM + Context + Tools
The entire book revolves around a single formula: Agent = LLM + Context + Tools . The author argues this decomposition captures the essence of an Agent: the LLM handles understanding and decision-making, context supplies background and memory, and tools turn decisions into actions. Missing any component breaks the Agent.
Four-Part Structure Across Ten Chapters
Foundations (Ch.1) : Defines Agent and establishes that engineering competitiveness lies in the Harness (outer framework), not just the model.
Capabilities (Ch.2–4) : Covers context engineering (KV Cache, prompt engineering, context compression), user memory and knowledge bases (RAG, structured indexing, knowledge graphs), and tools (MCP protocol, perception/execution/collaboration tool categories, proactive tool discovery).
Extension (Ch.5–8) : Explores multimodal interaction, evaluation (building comparable test signals), and model post-training (when to use SFT vs. RL, tool-call internalization).
Evolution & Collaboration (Ch.9–10) : Addresses continuous learning from execution traces, knowledge updates, and multi-agent collaboration demonstrating emergent group intelligence.
103 Runnable Experiments
The book distinguishes itself by providing 103 runnable experiments — one per major concept — so readers can verify claims hands-on. Experiments use Python 3.11–3.13 and are managed with uv. For example, to run Chapter 1 experiments:
uv sync --locked --extra ch1
uv run python chapter1/context/main.pyAPI-key-required experiments include setup guides for Kimi, Zhipu, DeepSeek, and OpenRouter.
Three Ways to Use the Book
Read directly via the online site ( bojieli.github.io/ai-agent-book) or download PDF/EPUB.
Run experiments — the core value — by cloning the repo and executing chapter-specific code.
Contribute via pull requests: fix text, bugs, add experiments, or translate (already 14 languages).
Comparison with Other Resources
vs. scattered tutorials : Systematic, one formula through ten chapters, logical continuity.
vs. pure theory books : Adds 103 runnable experiments for empirical verification.
vs. framework-specific tutorials : Teaches universal principles and engineering methodology, not tied to a single framework.
The book assumes basic Python and LLM knowledge; absolute beginners should start elsewhere.
Key Takeaways
Decompose complex systems into independently researchable components (LLM, Context, Tools).
Context engineering determines the capability ceiling — better to optimize context than chase stronger models.
Real engineering differentiation lies in the Harness: memory, tools, evaluation, training.
The article concludes that for anyone serious about mastering AI Agents, this open-source, experiment-driven book is a rare systematic resource worth studying and running.
GitHub: github.com/bojieli/ai-agent-bookSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Geek Labs
Daily shares of interesting GitHub open-source projects. AI tools, automation gems, technical tutorials, open-source inspiration.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
