Understanding AI Agents: Design Principles and Engineering Practice

A comprehensive open-source book with 10 chapters and 95 hands-on experiments, based on 'Agent = LLM + Context + Tools' to take you from fundamentals to production.

Stars
★ 61k
Last updated
2d ago v3.1
FARS reviewed
Nov 07, 2026 +2 new
License
Apache-2.0
Primary language
Python

At a glance

How it runs
CLILibrary / SDK
Works with
Universal · cross-platform
Cost
Free software; you pay for model usage
Setup effort
Medium · a few setup steps
You'll need
Python 3.10+uvpipShell / CLINetwork accessLocal filesystem
Typical use
Developers wanting a systematic deep dive into AI Agent theory and engineering can follow the 10 chapters and run experiments from basics to production.
Not a fit if
  • Readers who only want the book text, not to run code
  • Teams without GPUs that want to run Chapter 8 post-training
Maintenance
Commits in the last 30 dayslast commit 2026-12-01latest release v3.1 (2026-11-22)+98.0 ★/day over 7 days

What does this agent do, and when should you use it?

This is the official open-source repository for Bojie Li's book 'Understanding AI Agents: Design Principles and Engineering Practice'. It contains the full 10-chapter text, compiled PDF/EPUB, and 95 chapter-by-chapter code experiments. The book is built around the core formula 'Agent = LLM + Context + Tools', covering LLM basics, context engineering, user memory and knowledge bases (RAG), tools and MCP, Coding Agents, evaluation, model post-training (SFT/RL), continuous evolution, multimodal interaction, and multi-agent collaboration. The repository provides the original Chinese version plus 12 community-translated languages (English, Spanish, Indonesian, Arabic, etc.) and online reading with multilingual support. Experiments require Python 3.10+, and can be installed with uv or pip. Some experiments need API keys or local Ollama.

The repository enables book reading and experiment execution: users can read online or download PDF/EPUB; read Markdown chapters (e.g., book/chapter1.md); run 95 experiments, e.g., uv run python chapter1/context/main.py. Experiments cover context compression, KV cache, RAG, knowledge graphs, MCP tool invocation, Coding Agents (e.g., SWE-bench), evaluation benchmarks (e.g., GAIA), model post-training (MiniMind, verl), multimodal (browser automation, robotics), and multi-agent (TalkAct, Stanford AI Town). A one-click clone script fetches external repos (e.g., android_world, OSWorld) as dependencies. Install dependencies per chapter with uv sync --locked --extra ch1, and configure API keys in .env (e.g., Kimi, GLM, DeepSeek).

  1. Developers wanting a systematic deep dive into AI Agent theory and engineering can follow the 10 chapters and run experiments from basics to production.
  2. Engineers working on context engineering (KV cache, compression) can run 9 experiments from Chapter 2.
  3. Developers building RAG or knowledge graph applications can use Chapter 3 examples for user memory, structured indexing, and knowledge graphs.
  4. Engineers integrating MCP protocols or building tools can leverage Chapter 4's 7 experiments, including event-driven async agents.
  5. Researchers or engineers exploring Coding Agents can use Chapter 5's 13 experiments with SWE-bench to practice code generation.
  6. ML researchers interested in model post-training (SFT/RL) can run 16 experiments in Chapter 7 using frameworks like MiniMind, verl, and unsloth.

Key setup facts

Pulled from the install and usage notes below. The project README has the current values.

Config files
.env .env.example

How do you install or deploy this agent?

Clone the repo: git clone https://github.com/bojieli/ai-agent-book.git. Install uv (official docs) or use pip. From the repo root, install per-chapter dependencies: uv sync --locked --extra ch1 (replace ch1 with chapter number) or python -m pip install -e ".[ch1]". System dependencies like browsers, CUDA, or FFmpeg may be required per experiment README.

How do you use this agent?

Read online at bojieli.github.io/ai-agent-book or download PDF/EPUB from Releases. To run experiments, set up .env (copy .env.example and add at least one provider key), then run from root, e.g., uv run python chapter1/context/main.py. For some experiments, clone external repositories using the appendix script.

Safety boundaries, hardening & integrations

Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.

Declared capability surface (blast radius)

Local shell command execution

Can run terminal commands; pair with approval gates or container/OS sandboxing.

Local filesystem read/write

Modifies local files; work on a clean Git branch or dedicated worktree.

Outbound network access

Makes outbound requests; verify telemetry settings and model data routing on private repos.

What are this agent's strengths and limitations?

Pros
  • Comprehensive coverage from theory to practice with 10 chapters and 95 hands-on experiments, making it a one-stop resource for learning AI agents.
  • Multilingual support: 13 languages including English, Spanish, etc., with online reading and community translations for global accessibility.
  • Open source and free under Apache-2.0, with all book content, images, and code accessible for learning and contribution.
  • Rich experiment variety spans RAG, MCP, coding agents, evaluation, post-training, multimodal, and multi-agent systems, ideal for applying concepts.
Limitations
  • Requires external API keys for many experiments, which may incur costs and depend on network access and provider availability.
  • Complex setup: requires Python 3.10+, uv or pip, and per-chapter dependency management; additional system dependencies like CUDA or browsers may be needed.
  • Many experiments rely on cloning external repositories (e.g., SWE-bench, GAIA) pinned to specific commits, adding setup steps and potential version conflicts.
  • Community translations may lag behind the Chinese original, so content could be outdated or inconsistent across languages.

How does this agent compare with similar options?

Key facts side by side with the most closely related agents.

Agent Source review Form / cost Stars Updated Language Full support on
Understanding AI Agents: Design Principles and Engineering Practice This agent 59 · Major gaps CLIFree + model costs ★ 61k 2d ago Python —
Haystack 67 · Some gaps Library / SDKFree + model costs ★ 27k today Python OpenAI API
Hello-Agents 53 · Major gaps Web appFree + model costs ★ 88k 20d ago Python OpenAI API
PowerContext 82 · Good CLIFree ★ 2k today Python Codex · Claude Code

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
59/ 100 5-point scale 3.0 / 5
This review covers the source as of Nov 07, 2026. The project has shipped 2 stable release(s) since, which have not been re-reviewed. The score and verdict describe the reviewed version only. Recent releases ↓
Trust 11/29
Reliability 8/14
Adaptability 15/18
Convention 12/18
Effectiveness 9/13
Verifiability 4/8
Why each dimension lost points
Trust11 / 29 · 1.9/5

The companion skills explicitly recommend minimal diffs, permission gates, sandbox validation, rollback, redaction, and evidence isolation; the code samples also show API configuration, tool calls, and run artifacts. These are mostly recommendations in the book, however, and the sample does not show consistent permission, confirmation, secret-handling, or rollback implementations across experiments, so those criteria receive 1. Source examples and references are concrete enough for source attribution 2, but the sample does not independently verify their provenance.

Reliability8 / 14 · 2.9/5

The skills give detailed methods for evaluation, failure attribution, and regression, while code records errors and separates non-completion from unsupported figures. The project configuration also documents dependency groups and a Python range. Scores are limited because the sample does not establish consistency between these principles and the full repository implementation, or a unified runtime diagnostic approach.

Adaptability15 / 18 · 4.2/5

Several skills describe use cases, triggers, and method boundaries in detail, covering book experiments, document editing, and agent evaluation, so audience/scenario coverage and trigger precision score 3. Capability boundaries and environment requirements are described, but guidance is distributed across experiments involving APIs, GPUs, and platform differences, with no single product boundary; these score 2.

Convention12 / 18 · 3.3/5

Chapter code, skills, dependency extras, examples, and pitfalls form a recognizable structure, and the Apache license text is complete. Deductions reflect that the sampled English README is only a redirect, the sample lacks a unified onboarding path, naming formats vary, and version/update guidance and maintenance ownership are limited. Information architecture, installation, naming, and limitations score 2; versioning and maintenance score 1.

Effectiveness9 / 13 · 3.5/5

The material offers reusable evaluation frameworks, state-bar patterns, and experiment entry-point guidance. Capability-based dependency groups and optional heavy training stacks show some cost control. The sample does not establish that reported experimental results are reproducible, or define consistent outputs and cost-benefit boundaries across the repository.

Verifiability4 / 8 · 2.5/5

Some claims point to chapter experiments, scripts, run records, or evidence manifests, and code comments distinguish completion from unknown correctness. This supports partial traceability and separation of fact from inference. Several quantitative claims in the sampled skills lack accompanying result artifacts or independent corroboration in the supplied material.

Risks and how to mitigate them
  • This is a book and companion-experiment repository; the limited skill and code sample does not establish it as a unified, deployment-ready agent product.
  • Some experiments may call external models, APIs, browsers, or GPUs. Review each experiment's permissions, secret configuration, dependencies, and side effects before adopting it.
  • Quantitative results and experimental claims in the sampled skills are not independently verified by the supplied material.
Evidence confidence: Low Reviewed Nov 07, 2026 Reviewed revision dbc046eb896a New commits since this review; the score may not cover them
See the full review method →
Maintain this project? Add the FARS badge to your README

The badge shows the current review score and verdict and links back to this page. It refreshes about once an hour after a re-review.

FARS

[![FARS review](https://followagents.com/badge/ai-agent-book.svg)](https://followagents.com/en/agents/ai-agent-book)
<a href="https://followagents.com/en/agents/ai-agent-book"><img src="https://followagents.com/badge/ai-agent-book.svg" alt="FARS review"></a>

Recent releases

Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.

  1. v3.1 v3.1 · 中文阅读器封面兼容性更新
    Release notes excerpt
    本次 v3.1 更新简体中文阅读器兼容版。封面直接引用 JPEG,支持跳过内嵌 SVG 的阅读器;目录、正文、图表和公式沿用 v3.0 教学修订版。标准 PDF、标准 EPUB 和其余各语种沿用 v3.0 的正式文件,书内版次仍标作 v3.0。 - [简体中文 PDF](https://github.com/bojieli/ai-agent-book/releases/download/v3.1/AI-Agents-in-Depth-zh-CN.pdf) - [简体中文标准 EPUB](https://github.com/bojieli/ai-agent-book/releases/download/v3.1/AI-Agents-in-Depth-zh-CN.epub) - [简体中文阅读器兼容 EPUB](https://github.com/bojieli/ai-agent-book/releases/download/v3.1/AI-Agents-in-Depth-zh-CN-kindle.epub) 附件包含 v3.0 发布的 16 个语言版本的 PDF、EPUB,以及简体中文阅读器兼容版。SHA256SUMS 记录 33 个文件的 SHA-256。 …
    View on GitHub ↗
  2. v3.0 v3.0 · 深入理解 AI Agent:中文教学修订版
    Release notes excerpt
    v3.0 中文教学修订版 这一版从一个贯穿全书的问题出发:用户把事情交给 Agent,它凭什么决定下一步,又凭什么说事情已经办成?前言用 Pine 协商账单说明两者的区别。客服口头答应减免时,助手可以报告承诺;等新账单开出来,才知道钱究竟减了多少。后续章节沿着这类委托,分别讲清模型、上下文、工具、运行环境和评估程序各管哪一步。 正文与结构 全书仍按前言、十章和后记编排。前六章讲怎样搭起能办事的系统,第七章通过运行轨迹定位问题,后三章分别讨论训练模型、从运行经验中学习,以及让多个 Agent 分工。前言增加按读者目标选择的阅读路线。波尔图演讲中关于交互模型、推理速度、现实世界工具、面向人和 Agent 的操作系统、持续学习的判断,分别落在正文案例和后记中。 | 章节 | 新增或重写的重点 | | --- | --- | | 1 · AI Agent 入门 | 用一次换汇任务区分模型决策、工具执行和结果回传,讲清功能组成“LLM + 上下文 + 工具”与工程实现“Model + Harness”。用 Pine 的预算判断、Multica 的工单和 AlphaEvolve 的程序搜索说明生活、办公、科研三类任务怎样授权、怎样判断进展。 | …
    View on GitHub ↗

FAQ

How much does it cost to run experiments?
Experiments call cloud LLM APIs, so costs vary based on model usage. Use free tiers from providers like Kimi, GLM, or DeepSeek, or leverage local Ollama for experiments that explicitly support it.
Do I need a GPU?
Most experiments are CPU-friendly, but Chapter 7's model training experiments (e.g., MiniMind, verl) may require GPU resources. The repository offers CPU-friendly all extra but excludes local training stacks; use special extras like vllm or unsloth for those.
What if an experiment fails?
Check the experiment status in docs/EXPERIMENT_STATUS.md. Cloning the repo does not guarantee experiments run. Review the chapter README and ensure dependencies and API keys are correctly configured.
Can I read offline?
Yes, download the PDF/EPUB for the best reading experience. The online version also supports offline-friendly features like chapter folding and full-text search (if cached).
How can I contribute or report issues?
Submit pull requests for errata, code improvements, new experiments, or translations. We recommend running the relevant experiments first to verify reproducibility.
Was this page helpful?
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related concepts