explainx.ainewsletter3.5k
TrendingNewsPathwaysSkills
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

corporate training

[email protected]

get started

Find your pathTake Free Evaluation

learn

pathways — start freeworkshopsbootcampscoursescertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcptoolsagentsllmsdesignsagi trackerranks

company

aboutvisionmissionteaminstructorscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource libraryfor LLMsexplainx.ai kids

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportprivacytermsdata rightssubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

On this page

  • TL;DR — question-first reference
  • What is bojieli/ai-agent-book?
  • Ten chapters — what each actually teaches
  • What people are asking after they star the repo
  • What to run first — copy-paste paths
  • API keys — what the README recommends
  • How this compares to explainx.ai's agent corpus
  • Honest limitations (read before you commit a weekend)
  • Who should read this book?
  • Summary
  • Related on explainx.ai
← Back to blog

explainx / blog

Bojie Li's AI Agent Book: Open-Source Textbook, 10 Chapters, and Runnable Code

Is bojieli/ai-agent-book free? English PDF? What to run first? explainx.ai maps 李博杰's 6.7k-star Apache 2.0 textbook — Agent = LLM + Context + Tools — vs MCP, skills, loop engineering, and coding-agent guides.

Jul 20, 2026·10 min read·Yash Thakker
AI AgentsOpen SourceHarness EngineeringMCPCoding AgentsChinese AI
go deep
Bojie Li's AI Agent Book: Open-Source Textbook, 10 Chapters, and Runnable Code

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.

Weekly digest3.5k readers

Catch up on AI

Curated AI updates on agents, skills, and MCP — delivered to your inbox. Unsubscribe anytime.


TL;DR — question-first reference

QuestionAnswer (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; English book-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

ChTopicRunnable highlightsHonest maturity
1Agent basics — RL vs LLM, model-as-agentweb-search-agent, context ablation✅ Strong starters
2Context engineering — KV cache, skills, compressionkv-cache, prompt-injection, agent-skills-ppt✅ Ablation-heavy
3Memory & knowledge — RAG, GraphRAG, agentic RAGagentic-rag, contextual-retrieval✅
4Tools — MCP perception/execution/collaborationThree MCP servers, async-agent (Flux)✅ MCP is production-shaped
5Coding Agentcoding-agent (17 tools), adaptive-log-parser, erp-agent✅ Flagship; Jul 2026 security + failure recovery refresh
6Evaluationmodel-benchmark, agent-cost-analysis📖 Many benchmarks need external clones
7Post-training — SFT, RL, RLHFAdaptThink, retool guides📖 GPU + external training repos
8Self-evolutionself-evolving-tools (Alita-style)✅ Selected demos
9Multimodal — live audio, browser-use, TTSlive-audio, streaming-speechMixed — browser-use often 📖
10Multi-agentvoice-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:

  1. README.en.md for repo navigation
  2. book-en/AI-Agents-in-Depth-Bojie-Li-v1.1.pdf for chapter text
  3. 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:

IconMeaningYour action
✅Runnable in-repocd chapterN/project && follow README; set API key
📖Reproduction guidegit clone external benchmark/training repo per appendix
🚧Design doc onlyRead 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 actions
  • collaboration-tools — browser automation, HITL, notifications, timers
  • agent-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

bash
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

bash
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

bash
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)

bash
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)

bash
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 reload
  • log-diagnosis — trace replay + regression test generation
  • erp-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

bash
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:

ProviderUse case in repoNotes
Kimi (Moonshot)ch1 search agent, long-context experimentsStrong Chinese + agent tooling
智谱 GLMCost-effective Chinese-capable runsPairs with explainx.ai GLM harness guides
SiliconFlowOpen models (DeepSeek, Qwen) — ch1 ablationGood for multi-model comparisons
Volcengine ARK (Doubao)Low-latency domestic CN accessListed in ch1 context ablation
OpenRouterch5 coding-agent multi-providerOne 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.aiDeepen with ai-agent-book
MCP protocol & securityWhat is MCP?, MCP security guidech4 MCP servers + docker-compose deployment
Agent skills & progressive disclosureAgent skills complete guidech2 agent-skills-ppt
Loops & harness engineeringLoop engineering guide, Anthropic harness postch1 ReAct/context ablation, ch4 async Flux, ch5 coding-agent loops
Coding agent productsOpenCode guide, Claude Code commandsch5 coding-agent source — build your own
RAG & memoryRAG vs MCP comparisonch3 agentic RAG, contextual retrieval, GraphRAG/RAPTOR
EvaluationSenior SWE-bench / agent benchmarksch6 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)

  1. Chinese-first, translations lag — English PDF is community-maintained; newest security/failure-recovery prose may be Chinese-only briefly.
  2. Chapter 6/7/9/10 heavy lifters need external clones — SWE-bench, verl, browser-use, TalkAct, robot sims — not in-repo.
  3. API costs add up — ablation sweeps and multi-agent games burn tokens; use ch6 cost tools first.
  4. Not a hosted course — no LMS, no certificates; you self-navigate EXPERIMENT_TRIAGE.md.
  5. 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.
  6. 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

  • RAG vs MCP comparison
  • Build your first MCP server

Registries

  • Agent skills directory
  • MCP servers directory

Official source

  • bojieli/ai-agent-book on GitHub

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.

Yash Thakker

Written by

Yash Thakker

Yash is an AI expert with over 300K learners. Join his workshops →

Related posts

Aug 5, 2026

LoopX: A Control Plane for Long-Running AI Agent Work

LoopX doesn't run your agent — it keeps the durable state around multi-day agent work stable: objectives, human gates, todo ownership, evidence, and quota, across Codex, Claude Code, Cursor, or any runtime. explainx.ai breaks down the state-kernel model, how it differs from a harness, and where it fits next to Pi and loop engineering.

Jun 21, 2026

Palmier Pro: The Open Source Video Editor Where Claude Edits the Timeline With You

Palmier Pro is the first video editor where your AI agent has hands on the timeline. Free to download, open source, Swift-native. Claude connects via a local MCP server and can generate footage, trim, reorder clips, and iterate prompts — all in one project. We used it to edit a YouTube Short and built a skill for it. Here is the full setup guide.

Apr 13, 2026

holaOS (Holaboss): an open agent environment for workspaces, memory, and long runs

Holaboss’s holaOS repo frames agents as needing an OS-like layer: runtime, tools, apps, and state that survives across runs. Here is a builder’s map of the thesis, the stack, and the Reddit conversation around “role-holding” workspaces.