RepoDaily · 2026-07-23 · AI model / Agent framework

92 Open-Source Experiments Teach AI Agent Design from Context Engineering to RAG

#2 AI model / Agent framework Python +3,700 bojieli/ai-agent-book Open repository

Bojieli's 10-chapter open-source book pairs runnable Python experiments with production-oriented agent theory, covering the Agent = LLM + Context + Tools formula across memory, knowledge graphs, and tool integration.

Repo typeAI model / Agent framework
Best forEngineers and researchers who want a structured, experiment-driven path through AI agent internals — context engineering, memory, RAG, and tool use
Risk levelLow — Apache-2.0 open-source book and code, no runtime dependency
Time to evaluate2–3 hours to read chapters 1–3 online and run the first companion experiments

Primary question: Do you want to understand why agents work, not just how to call an agent framework?

95/100

RepoDaily adoption score

RepoDaily rates this as 95/100 (strong) for adoption: evidence, installation path, production risk, differentiation, license clarity, and AI/agent fit are scored from the article sources and adoption notes.

Directional score from RepoDaily sources and adoption notes, not a benchmark.Risk: Low
100Evidence quality

5 source(s) across 3 source category/categories, plus a RepoDaily-specific evidence module when available.

88Installability

4 workflow step(s), 4 next-action step(s), and 2 command/install signal(s) were detected.

87Maintenance confidence

Trending momentum is +3,700 stars, with maintenance/release/issue signals counted when present.

100Production readiness

Risk is marked low, with 4 security note(s) and 3 explicit skip condition(s).

100Differentiation

3 opportunity lens item(s), 4 alternative(s), and 3 type-specific section(s) support differentiation.

82License clarity

License source or license wording is present.

96Agent / AI fit

6 AI/agent-related signal(s) were detected in the article text and metadata.

Project overview

bojieli/ai-agent-book is the open-source repository for 《深入理解 AI Agent:设计原理与工程实践》(Deep Understanding of AI Agents: Design Principles and Engineering Practice), authored by Li Bojie. The repo packages three deliverables together: the full Chinese-language book text across 10 chapters, compiled PDF and EPUB files in 6 languages, and 92 companion code experiments — over 70 of which can run independently. The entire project is licensed under Apache-2.0.

The book is organized around a single formula: Agent = LLM + Context + Tools. Rather than teaching a specific framework's API, the chapters dissect how each component of that formula works — from KV Cache and prompt engineering in chapter 2's context engineering, to user memory, RAG, structured indexing, and knowledge graphs in chapter 3. The progression builds mental models an engineer can apply regardless of which framework they later choose.

The repository is not a library or SDK. It is a learning resource: a book with runnable, chapter-aligned code. The online reading site at bojieli.github.io/ai-agent-book/ supports multi-language switching, chapter folding, full-text search, and direct links to companion experiments. The site auto-rebuilds on every push to the main branch. PDF and EPUB files are distributed through GitHub Releases, with the latest build always pointing to the main branch.

Problem it solves

  • AI agent concepts are scattered across blog posts, papers, and framework documentation with no unified, experiment-driven learning path
  • Engineers building agents often lack grounding in context engineering — KV Cache, prompt design, context compression — which determines real agent capability ceilings
  • Most agent tutorials teach framework APIs rather than the underlying design principles that transfer across frameworks
  • Non-Chinese speakers had limited access to in-depth, production-oriented Chinese agent engineering material before the community translations arrived

How it works

  1. Read the book: open the online reading site (bojieli.github.io/ai-agent-book/) or download the PDF/EPUB from GitHub Releases — no installation required
  2. Follow the Agent = LLM + Context + Tools formula through 10 chapters that progress from agent fundamentals to production concerns
  3. Run companion experiments: each chapter directory (chapter1/ through chapter10/) contains standalone Python projects demonstrating the chapter's concepts
  4. Optionally compile your own PDF: install pandoc, xelatex, and ElegantBook, then run `cd book && bash build_pdf.sh` to generate the PDF from Markdown sources

Product demo and interface preview

Star History Chart
Star History Chart — The repository's star history, sourced from the official README, shows the growth trajectory of community interest in this open-source AI agent book. README.md image

How to Start Reading and Running Experiments

  • Fastest path: open bojieli.github.io/ai-agent-book/ for the online reading experience with full-text search and chapter folding
  • Download path: grab AI-Agents-in-Depth-zh-CN.pdf or .epub from the GitHub Releases page for offline reading
  • Hands-on path: clone the repo and navigate to chapter directories (chapter1/ through chapter10/) — chapter 1 has 4 code projects, chapter 2 has 9, chapter 3 has 13
  • Build path: for self-compiled PDF, install pandoc + xelatex + ElegantBook, run `cd book && bash build_pdf.sh`; figures are generated by `book/gen_*_figs.py` and stored in `book/images/`
  • Translation path: Chinese source lives in `book/`; English in `book-en/`, Russian in `book-ru/`, Traditional Chinese in `book-zhtw/`, Tamil in `book-ta/`, Vietnamese in `book-vi/` — community translations may lag behind the original

Build Commands and Repository Layout

The book source follows a straightforward structure. Chapter text lives in `book/introduction.md`, `book/chapter1.md` through `book/chapter10.md`, and `book/afterword.md`. The single build command is `cd book && bash build_pdf.sh`. Typesetting configuration sits in `book/preamble.tex` and `book/*.lua` files. EPUB build instructions are documented in `EPUB.md` and support all 6 languages.

Companion code is organized by chapter: `chapter1/README.md` through `chapter10/README.md` serve as entry points. The first three chapters alone contain 26 experiments (4 + 9 + 13), covering agent basics, context engineering, and user memory/knowledge base topics.

What You Need Before Diving In

  • To read: nothing — the online site and PDF require no setup
  • To run experiments: Python environment (the repo's primary language), plus any chapter-specific dependencies listed in each chapter directory
  • To compile PDF: pandoc, xelatex, ElegantBook document class, and related fonts
  • License: Apache-2.0 — permits commercial use, modification, and redistribution with attribution

Who should pay attention?

Good fit if

  • Engineers transitioning into LLM application development who want principled understanding, not just API familiarity
  • Teams evaluating agent architectures who need a shared vocabulary across context engineering, harness engineering, and structured indexing
  • Educators building AI agent courses who want open-source material with 92 ready-to-run experiments
  • Chinese-speaking developers who want in-depth, production-oriented content in their native language

Skip for now if

  • Developers looking for a drop-in agent framework or SDK to import — this is a book, not a library
  • Teams that need production agent infrastructure rather than learning material
  • Readers who only want surface-level prompt engineering tips without the underlying engineering depth

Risks and cautions

Low

This is an educational resource (book + companion code), not a runtime dependency. No production system depends on it, and the Apache-2.0 license is maximally permissive.

  • Apache-2.0 license permits free use, modification, and redistribution including commercial use
  • Code experiments are standalone Python projects designed for learning, not production deployment
  • No API keys, cloud credentials, or external services are required to read the book text
  • Community translations (English, Russian, Tamil, Vietnamese, Traditional Chinese) may lag behind the original Chinese — verify chapter completeness if relying on a translation
  • Apache-2.0 license: permits commercial use, modification, distribution, and includes a patent grant
  • No external API calls or data transmission required for reading the book or viewing the online site
  • Companion experiments are local Python projects — review each experiment's dependencies before running
  • GitHub Releases PDFs are built from the main branch on each push — verify file integrity if using for compliance-sensitive contexts

Alternatives to compare

ApproachWhen to useTrade-off
microsoft/ai-agents-for-beginners
You want a shorter, Microsoft-ecosystem-focused introduction to agent conceptsFree (MIT license)
dair-ai/Prompt-Engineering-Guide
You want a broader prompt engineering reference without the deep agent architecture focusFree (MIT license)
LangChain documentation and cookbooks
You need framework-specific agent patterns and production deployment examples rather than underlying theoryFree
University or MOOC AI courses
You need formal accreditation or a structured curriculum with instructor feedbackVaries

What this trend reveals

Internal Agent Training Curriculum

Engineering teams adopting AI agents can use the 10-chapter structure as an internal training curriculum. Each chapter pairs with runnable experiments, so teams assign chapters and have engineers complete the companion code as hands-on exercises.

Confirm that chapter topics (context engineering, RAG, knowledge graphs, tool use) map to your team's planned agent use cases, then assign chapters 1–3 as a pilot.

Context Engineering Deep Dive

Chapter 2 covers KV Cache, prompt engineering, agent skills, and context compression — topics that directly affect production agent cost and latency. Engineers optimizing real agent systems can extract the chapter's 9 experiments and adapt them to their own context management pipelines.

Read chapter 2 online, run its 9 companion experiments, and measure whether the context compression techniques reduce your own agent's token usage.

Multilingual Knowledge Transfer

With 6-language translations, the book can serve as a shared reference across global teams. The Chinese original is authoritative; translations by @tigercosmos (Traditional Chinese), @nsdevaraj (English/Tamil), @ui99ru (Russian), and @toanalien (Vietnamese) extend reach.

Check whether your team's primary languages are covered and whether the translation for your target chapters is complete enough for practical use.

Best next action

Read Chapters 1–3 Online, Then Run the First Companion Experiments

The fastest way to assess whether this book matches your learning needs is to read the first three chapters on the online site — they cover the core Agent formula, context engineering, and memory/RAG — then run 2–3 experiments from the chapter directories.

  1. Open bojieli.github.io/ai-agent-book/ and read chapter 1 (Agent basics) and chapter 2 (Context engineering)
  2. Clone the repository and navigate to chapter1/ and chapter2/ directories
  3. Run 2–3 experiments from the first two chapters to confirm they execute in your Python environment
  4. If the depth and style match your needs, continue to chapter 3 for memory and knowledge base topics

RepoDaily verdict

A rare open-source resource that combines production-depth AI agent theory with 92 runnable experiments under an Apache-2.0 license. Best suited for engineers who want to understand agent internals — not just framework APIs — and who value hands-on practice alongside conceptual depth. The 6-language translation effort and auto-rebuilding online reading site make it accessible to a global audience, though community translations may lag behind the authoritative Chinese original.

Sources