bojieli/ai-agent-book
《深入理解 AI Agent:设计原理与工程实践》(李博杰 著)开源主仓库:全书正文、编译版 PDF 与按章配套代码
📚 What is AI‑Agent‑Book?
AI‑Agent‑Book is an open‑source, multilingual textbook that walks readers through the theory and engineering of AI agents – systems built from a large language model (LLM), a context (prompt, memory, knowledge base) and external tools. The book is split into 10 chapters that start with the basics and end with multi‑agent collaboration, and each chapter is paired with real, runnable experiments (109 in total) that let you try the concepts yourself.
🎯 Who is it for?
- Practitioners who want a hands‑on guide to building production‑grade agents.
- Researchers looking for a curated set of reproducible experiments and benchmark references.
- Students who prefer a structured learning path with code they can run.
- Anyone interested in the Agent = LLM + Context + Tools formula, from prompt engineering to continuous evolution.
🛠️ Core Features
| Feature | What you get |
|---|---|
| Complete textbook | 10 chapters covering fundamentals, context engineering, memory/RAG, tool use, coding agents, multimodal interaction, evaluation, fine‑tuning, lifelong learning, and multi‑agent cooperation. |
| 109 companion experiments | Ready‑to‑run Python projects (Python 3.11‑3.13) for each chapter. Install with uv sync --extra chX or via pip. |
| Multi‑language support | The core Chinese manuscript plus community translations into 15 languages (English, Spanish, Indonesian, Arabic, Traditional Chinese, Russian, Tamil, Vietnamese, Japanese, Turkish, Korean, Hungarian, Hebrew, Portuguese‑BR). |
| PDF/EPUB downloads | Offline‑readable, beautifully typeset versions (PDF built with Pandoc, XeLaTeX, ElegantBook). |
| Online reader | Web UI (https://bojieli.github.io/ai-agent-book/) with chapter folding, full‑text search, and direct links to experiments. |
| Extensible experiment ecosystem | Scripts to clone 22 external repositories (e.g., Claude quickstarts, browser‑use, XLeRobot, GAIA benchmark) that the book references. |
| Clear contribution guide | Open‑source licensing (Apache‑2.0), issue templates, and a list of contribution types (content, code, translations, graphics). |
| Sponsorship & API keys | Recommendations for LLM providers (Kimi, GLM, SiliconFlow, DeepSeek, Atlas Cloud, Krill AI, OpenRouter) plus a discount code for Krill AI users. |
📂 Repository Layout (high‑level)
book/– Markdown source of the Chinese edition (chapter 1‑10, afterword, preamble).book‑en/,book‑es/, … – Translated versions (community‑maintained).chapterX/– Subfolders for each chapter’s experiments (e.g.,chapter1/context/).EPUB.md– Build instructions for the EPUB version.docs/EXPERIMENT_STATUS.md– Tracks which experiments are fully functional.LICENSE– Apache‑2.0.
🚀 Getting Started with an Experiment
# Install the UV package manager (optional but recommended)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Sync dependencies for Chapter 1 (replace ch1 with ch2 … ch10 as needed)
uv sync --locked --extra ch1
# Run the demo (same command works with pip‑installed env)
uv run python chapter1/context/main.py
All experiments require an LLM API key (set in a .env file or environment variable). The README for each experiment lists the exact provider(s) it supports.
📖 How to Use the Book
- Read – Browse chapters directly on GitHub or via the online reader.
- Run – Follow the per‑chapter “实验” link to clone/run the associated code.
- Iterate – Modify the code, try different prompts, swap models, or add new tools to deepen understanding.
- Contribute – Fix a typo, improve a diagram, add a new experiment, or translate a chapter.
🙌 Community & Support
- Contributors are listed on the front page; anyone can open PRs or issues.
- Sponsor: Krill AI provides a discount code (
ai-agent-book) for its paid plans. - Discussion: Issues are the primary place for questions about experiments, missing dependencies, or translation help.
🎓 TL;DR
AI‑Agent‑Book is a free, multilingual textbook plus a full suite of reproducible Python experiments that teach you how to design, build, evaluate, and evolve LLM‑powered agents. It’s a practical learning resource rather than just theory, making it a solid entry point for anyone wanting to get hands‑on with modern AI agents.
Related
- Project
- Project
- Project
- Project
- Project