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.

Geek Labs
Geek Labs
Geek Labs
Open-Source AI Agent Book: 10 Chapters, 103 Runnable Experiments

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.py

API-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-book
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

PythonLLMopen sourceAI agentSFTmulti-agentMCP protocolTool UseRLcontext engineering
Geek Labs
Written by

Geek Labs

Daily shares of interesting GitHub open-source projects. AI tools, automation gems, technical tutorials, open-source inspiration.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.