July 2026: bojieli/ai-agent-book crossed ~6.7k GitHub stars and 618 forks roughly one week after the repo went public on July 13 — per the maintainer's star-history chart in assets/. Author 李博杰 (Bojie Li / bojieli) open-sourced 《深入理解 AI Agent:设计原理与工程实践》 — English subtitle "AI Agents in Depth" — as a full textbook: 10 chapters, Apache 2.0 license, Chinese PDF v1.1, community English/Tamil/Vietnamese PDFs, and chapter-matched runnable code.
If you landed from GitHub Trending or a Chinese AI thread, you probably want answers before you clone 294 commits of Python: Is it free? English version? What runs today without a GPU cluster? How does this relate to MCP, agent skills, and loop engineering?
This post is that map — question-first, honest about Chinese-first lag and external-repo dependencies, with copy-paste paths for the demos worth running this week.
TL;DR — question-first reference
| Question | Answer (July 20, 2026) |
|---|---|
| Is it free? | Yes — Apache 2.0; PDFs + source + code. You pay LLM API usage on ✅ runnable demos |
| English version? | Community PDF in book-en/ — may lag Chinese book/ (v1.1 both, content sync not guaranteed) |
| Core formula? | Agent = LLM + 上下文 + 工具 → Agent = LLM + Context + Tools |
| Harness angle? | Everything outside the model (context, tools, loops, eval) is the competitive edge — matches harness engineering discourse on explainx.ai |
| What to run first? | chapter1/web-search-agent → chapter2/kv-cache → chapter4/perception-tools → chapter5/coding-agent |
| Fully local, no keys? | Partial — chapter4/perception-tools uses free public APIs; most agent loops need one API key |
| vs explainx.ai guides? | Book = curriculum + code; explainx.ai = live tool setup, security, product comparisons (OpenCode, Claude Code, MCP hosts) |
| Star velocity? | ~6.7k stars in ~1 week since Jul 13 (README star-history note) |
| License gotcha? | Apache 2.0 repo-wide; some subprojects may carry their own licenses — check per folder |
What is bojieli/ai-agent-book?
The repo is the canonical open-source home for Bojie Li's AI agent textbook — not a slides-only repo or a single demo. It ships:
- Manuscript source:
book/introduction.md,book/chapter1.md…book/chapter10.md,book/afterword.md - Compiled PDFs: Chinese original
book/深入理解-AI-Agent-李博杰-v1.1.pdf; Englishbook-en/AI-Agents-in-Depth-Bojie-Li-v1.1.pdf; Tamil and Vietnamese community builds - Companion code:
chapter1/…chapter10/with projects labeled ✅ runnable, 📖 reproduction guide (external clone), or 🚧 design doc only - Build toolchain:
cd book && bash build_pdf.sh(pandoc + xelatex + ElegantBook)
The organizing thesis, repeated from chapter 1:
Agent = LLM + Context + Tools
And the harness punchline that explains why the repo exploded while raw model benchmarks saturate:
Harness engineering — everything outside the model — is where production agents win or lose.
That framing aligns with explainx.ai's context → prompt → loop stack and loop engineering for coding agents: the model is necessary; the orchestration is sufficient for differentiation.
Ten chapters — what each actually teaches
| Ch | Topic | Runnable highlights | Honest maturity |
|---|---|---|---|
| 1 | Agent basics — RL vs LLM, model-as-agent | web-search-agent, context ablation | ✅ Strong starters |
| 2 | Context engineering — KV cache, skills, compression | kv-cache, prompt-injection, agent-skills-ppt | ✅ Ablation-heavy |
| 3 | Memory & knowledge — RAG, GraphRAG, agentic RAG | agentic-rag, contextual-retrieval | ✅ |
| 4 | Tools — MCP perception/execution/collaboration | Three MCP servers, async-agent (Flux) | ✅ MCP is production-shaped |
| 5 | Coding Agent | coding-agent (17 tools), adaptive-log-parser, erp-agent | ✅ Flagship; Jul 2026 security + failure recovery refresh |
| 6 | Evaluation | model-benchmark, agent-cost-analysis | 📖 Many benchmarks need external clones |
| 7 | Post-training — SFT, RL, RLHF | AdaptThink, retool guides | 📖 GPU + external training repos |
| 8 | Self-evolution | self-evolving-tools (Alita-style) | ✅ Selected demos |
| 9 | Multimodal — live audio, browser-use, TTS | live-audio, streaming-speech | Mixed — browser-use often 📖 |
| 10 | Multi-agent | voice-werewolf, parallel-web-research | ✅ Fun + instructive; some 📖 |
July 2026 repo activity worth noting: Chapter 5 was reorganized — security consolidated, new failure & error recovery section; Tamil/Vietnamese READMEs landed; star-history matplotlib chart added to assets/ with daily GitHub Actions refresh.
What people are asking after they star the repo
"Do I need to read Chinese?"
Chinese is the authoritative language for the PDF and fastest-updated prose. English readers should use:
README.en.mdfor repo navigationbook-en/AI-Agents-in-Depth-Bojie-Li-v1.1.pdffor chapter text- Code READMEs — mostly English for runnable paths
Expect lag: Community translations trail the Chinese book/ commits. If you're citing the new ch5 failure-recovery material from July 2026, verify it exists in book-en/ before assuming parity.
"Which projects run today vs need external clones?"
The repo labels every project. EXPERIMENT_TRIAGE.md is the honest index. Rule of thumb:
| Icon | Meaning | Your action |
|---|---|---|
| ✅ | Runnable in-repo | cd chapterN/project && follow README; set API key |
| 📖 | Reproduction guide | git clone external benchmark/training repo per appendix |
| 🚧 | Design doc only | Read architecture; code pending |
Not ✅ without extra work: Chapter 6 benchmarks (Terminal-Bench, SWE-bench, GAIA, OSWorld), most chapter 7 training frameworks, chapter 9 browser-use / claude-quickstarts, chapter 10 use-computer-while-calling (moved to TalkAct upstream).
Appendix clone commands live at the bottom of the README — save them as a script when you need eval or training depth, not on day one.
"How does this connect to MCP and agent skills?"
Chapter 4 is the direct bridge to explainx.ai's MCP architecture guide:
perception-tools— search, multimodal parse, filesystem, public data (many free APIs)execution-tools— file ops, code interpreter, LLM second-approval for dangerous actionscollaboration-tools— browser automation, HITL, notifications, timersagent-with-event-trigger— FastAPI event-driven agent loading all three MCP servers
Chapter 2's agent-skills-ppt implements progressive disclosure — thin skill catalog at startup, full pptx skill loaded on demand — the same pattern explainx.ai documents in What are agent skills?. If you've installed skills via npx skills or the /skills registry, this demo shows the mechanism in plain Python.
Chapter 5's coding-agent is a pedagogical counterpart to product harnesses like OpenCode and Claude Code: 17 pure-Python tools, pure-Python grep (no ripgrep binary), multi-provider (Anthropic, OpenAI, OpenRouter), persistent shell, lint detection, streaming. It teaches how a coding agent is built — not which subscription to buy.
What to run first — copy-paste paths
1. Clone and orient
git clone https://github.com/bojieli/ai-agent-book.git
cd ai-agent-book
# Read labels before investing time
cat EXPERIMENT_TRIAGE.md
2. Chapter 1 — model-as-agent search
cd chapter1/web-search-agent
# Follow README: set MOONSHOT_API_KEY or provider of choice
python main.py # or entrypoint named in README
Why first: Smallest loop that shows LLM + tools without MCP boilerplate. Pairs with chapter1/context for ablation — toggle context components and watch behavior shift (SiliconFlow Qwen, Doubao, Kimi supported).
3. Chapter 2 — KV cache and prompt injection
cd chapter2/kv-cache
# Experiments: cache-friendly vs cache-hostile context patterns
cd ../prompt-injection
# 3 attack scenarios × 4 defense configs — deterministic success-rate stats
Connects to: Context engineering stack and token economics in chapter6/agent-cost-analysis later.
4. Chapter 4 — MCP trilogy (mostly key-free perception)
cd chapter4/perception-tools
# MCP server — DuckDuckGo, Open-Meteo, etc.
cd ../execution-tools
# LLM approval gate on destructive ops
cd ../async-agent
# Flux: inbox queue, parallel tools, interrupt mid-turn
Connects to: /mcp-servers directory and build your first MCP server on explainx.ai.
5. Chapter 5 — production coding agent (flagship)
cd chapter5/coding-agent
export ANTHROPIC_API_KEY=... # or OPENAI_API_KEY / OpenRouter
python -m coding_agent # verify exact module in README
17 tools, Mac-friendly (no CLI ripgrep dependency). July 2026: security section consolidated; failure & error recovery added — read book/chapter5.md or PDF before hardening your own harness.
Also worth it in ch5:
adaptive-log-parser— self-healing: failed parse → codegen new parser → hot reloadlog-diagnosis— trace replay + regression test generationerp-agent— NL2SQL artifact pattern (LLM writes SQL, DB returns rows — no token-heavy data through the model)
6. Chapter 8 & 10 — when you want "wow" demos
cd chapter8/self-evolving-tools
# Alita-style: discover libraries from the web, sandbox-test, register tools
cd ../../chapter10/voice-werewolf
# Multi-agent private contexts + deterministic judge audit
cd ../parallel-web-research
# Parallel search agents + cascade cancel when one hits
API keys — what the README recommends
You need at least one LLM provider for most ✅ demos. The maintainer suggests:
| Provider | Use case in repo | Notes |
|---|---|---|
| Kimi (Moonshot) | ch1 search agent, long-context experiments | Strong Chinese + agent tooling |
| 智谱 GLM | Cost-effective Chinese-capable runs | Pairs with explainx.ai GLM harness guides |
| SiliconFlow | Open models (DeepSeek, Qwen) — ch1 ablation | Good for multi-model comparisons |
| Volcengine ARK (Doubao) | Low-latency domestic CN access | Listed in ch1 context ablation |
| OpenRouter | ch5 coding-agent multi-provider | One key for Claude, GPT, Gemini without separate billing setups |
Cost sanity check: Run chapter6/model-benchmark (TTFT, p50/p95 latency) and chapter6/agent-cost-analysis (per-step token/cost tracing on a refund workflow) before picking a default provider for long agent sessions.
How this compares to explainx.ai's agent corpus
| You want… | Start here on explainx.ai | Deepen with ai-agent-book |
|---|---|---|
| MCP protocol & security | What is MCP?, MCP security guide | ch4 MCP servers + docker-compose deployment |
| Agent skills & progressive disclosure | Agent skills complete guide | ch2 agent-skills-ppt |
| Loops & harness engineering | Loop engineering guide, Anthropic harness post | ch1 ReAct/context ablation, ch4 async Flux, ch5 coding-agent loops |
| Coding agent products | OpenCode guide, Claude Code commands | ch5 coding-agent source — build your own |
| RAG & memory | RAG vs MCP comparison | ch3 agentic RAG, contextual retrieval, GraphRAG/RAPTOR |
| Evaluation | Senior SWE-bench / agent benchmarks | ch6 Terminal-Bench, SWE-bench, GAIA guides + cost tools |
Bottom line: explainx.ai answers "how do I configure X today?" The book answers "how would I build X from first principles?" They're complementary — not substitutes.
Honest limitations (read before you commit a weekend)
- Chinese-first, translations lag — English PDF is community-maintained; newest security/failure-recovery prose may be Chinese-only briefly.
- Chapter 6/7/9/10 heavy lifters need external clones — SWE-bench, verl, browser-use, TalkAct, robot sims — not in-repo.
- API costs add up — ablation sweeps and multi-agent games burn tokens; use ch6 cost tools first.
- Not a hosted course — no LMS, no certificates; you self-navigate
EXPERIMENT_TRIAGE.md. - Product harnesses move faster than PDFs — Claude Code
/loop, Cursor subagents, OpenCode Zen may outpace book examples; cross-check explainx.ai for current CLI flags. - Single open issue, nine open PRs (as of user share) — active but young; pin commits when reproducing paper numbers.
Who should read this book?
Strong fit:
- Engineers building custom agents who want theory + runnable reference implementations
- Teams standardizing on MCP who want three worked server types before writing their own
- Developers comparing harness patterns (context ablation, cost tracing, self-evolving tools) with productized agents
- Readers of Chinese AI engineering discourse who want the 李博杰 curriculum in one repo
Skip or defer if:
- You only need Claude Code / Cursor setup — start with explainx.ai harness guides instead
- You have no API budget and won't run local models — many loops need inference
- You want certification or video lectures — this is text + code
Summary
bojieli/ai-agent-book is the most complete open-source AI agent textbook shipped in July 2026: Apache 2.0, ~6.7k stars, Agent = LLM + Context + Tools, and harness engineering as the moat. Read the Chinese or community English PDF, then run chapter1/web-search-agent → chapter2/kv-cache → chapter4/perception-tools → chapter5/coding-agent before touching external benchmark clones.
Pair it with explainx.ai's live coverage of MCP, agent skills, loop engineering, and OpenCode for the full picture — book for depth, explainx.ai for deployment reality.
Related on explainx.ai
Agent foundations
- What is MCP? Model Context Protocol guide
- What are agent skills? Complete guide
- Context → prompt → loop harness stack
Harness & coding agents
- Loop engineering: coding agents guide
- Anthropic engineer: harness engineering explained
- OpenCode: open source coding agent guide
- Claude Code commands reference
Evaluation & RAG
Registries
Official source
Repository stats, star counts, chapter labels, and translation status are accurate as of July 20, 2026. Verify ✅/📖/🚧 labels in EXPERIMENT_TRIAGE.md before planning a reproduction — the maintainer adds runnable demos frequently.
