Case Studies

A 40k-Star AI Agent Book Built by One Person: 103 Experiments, 14 Languages

Li Bojie's 10-chapter open-source book on AI agents hit GitHub Trending with 103 hands-on experiments and 14 community-translated languages. A look at the content engineering, versioning, and community workflow that holds it together.

Font size

GitHub is overflowing with AI agent projects and frameworks—LangChain, AutoGen, CrewAI, LangGraph, Agno—but books that actually explain what an agent is and why it's built that way are rare.

Most of what exists lives in scattered blog posts, tutorials, and READMEs. To get a systematic grounding in agent fundamentals, you either read papers or stitch together a dozen Medium links.

Li Bojie (GitHub: bojieli) took a different route: a 10-chapter Chinese-language open-source technical book called bojieli/ai-agent-book, with 103 runnable experiments, 14 language translations, and an Apache-2.0 license. It has 40,004 stars and has appeared on GitHub Trending as Project of the Day.

It's not a software framework—you can't pip install it. It solves a different problem: systematically understanding agents without drowning in fragmented blog posts and framework READMEs.


What Problem It Solves

The book's central formula boils down to one line:

Agent = LLM + Context + Tools

Around that formula, the project delivers 10 chapters of body content plus 103 standalone experiments. No framework pitches, no API upsell, no funding rounds.

Four delivery formats:

  • Online reading: bojieli.github.io/ai-agent-book
  • Offline PDF / EPUB downloads from the release page
  • Raw Markdown source in the GitHub repository
  • Per-chapter code directories with experiment scripts

PDF and EPUB links are pinned to latest. Every push triggers a CI rebuild, the URL stays the same, and readers always get the freshest build. It's an underused trick of GitHub Releases.

How to Use It

Three typical paths:

Path 1: Read straight through.

Open the online site, switch chapters via the left sidebar, switch languages from the top-right. Full-text search works. Offline readers grab the PDF and toss it on a Kindle.

Path 2: Read and run.

git clone https://github.com/bojieli/ai-agent-book.git
cd ai-agent-book
ls
# You should see chapter1/ chapter2/ ... chapter10/ directories

Each chapter directory has a README listing dependencies. Set the OPENAI_API_KEY environment variable, run pip install, and you're ready to run python xxx.py.

Path 3: Use it as team curriculum.

A Chinese-language book plus matching experiments plus multilingual versions—tech leads can run an internal Agent 101 course without assembling their own training materials.

The fastest on-ramp: clone the repo, enter the first chapter directory, follow the README to install dependencies, and run the first ReAct loop demo.

How It's Built (Architecture)

Three layers:

Content layer: Markdown manuscript split by chapter. Each chapter has its own chapterN/ directory, pairing the prose with experiment code.

Build layer: Pushes trigger GitHub Actions that automatically build PDF/EPUB and publish them to GitHub Releases, with links pinned to latest.

Operations layer:

  • GitHub Pages hosts the online reader
  • Translation branches: docs/en, docs/es, docs/id … 14 languages in total
  • Community PR flow: translator forks → translates their language → submits PR → author merges

Version 2.0 reorganized the chapters: the old Chapter 4 ("Asynchronous Interaction") and old Chapter 9 ("Multimodal Agents") were merged into a new Chapter 6 ("Interaction: Expanding the Observation and Action Spaces"), and the original Chapters 6/7/8 shifted down. Returning readers will be momentarily confused and need to relearn chapter numbers.

The key workflow in one sentence: author writes the Chinese main branch → community forks and translates → PRs get merged → CI auto-builds multilingual PDFs → release.

That pipeline alone is a working blueprint for how to publish an open-source technical book.

Where It Works / Where It Doesn't

What works:

  1. Solid content asset. 40k stars and a GitHub Trending Project of the Day slot—distribution reach exceeding most agent frameworks. Hitting that level as a solo author is only possible because the book is genuinely systematic.
  2. Multilingual barrier lowered to near zero. Release links pinned to latest mean readers always get the newest version. Coverage of 14 languages—including less common picks like Hebrew, Tamil, Vietnamese, and Greek—is genuinely friendly to developers worldwide.
  3. Read-plus-run loop. Each experiment maps one-to-one to a section of prose. Finish the theory, run the code, verify. Better than reading alone.

What doesn't:

  1. Not a software framework. You can't pip install ai-agent-book, and you can't drop it into a production stack. For shipping real systems, you still need an SDK like LangGraph or Agno.
  2. Per-topic depth takes a hit. The experiment code skews pedagogical and stays lightly abstracted. Compared with something like LangChain's heavily abstracted library, individual pieces don't go as deep. A book that aims for system coverage has to make those trade-offs.
  3. Translation quality varies. All 14 translations are community-driven; the author only maintains the Chinese source. High-traffic languages (English, Spanish, Indonesian) iterate fast; smaller ones may lag by months.
  4. Chapter numbers shifted in 2.0. Notes tied to the old chapter numbering need to be reorganized.

Hands-On Notes

Cloning the repo took about two minutes (network-dependent). The directory structure is immediately readable: root holds the book manuscript in Markdown, chapter subdirectories hold experiment code.

The online site at bojieli.github.io loads quickly. Full-text search works. Chinese fonts render cleanly. The Chinese PDF download is around 15 MB, cleanly laid out, with proper code-block highlighting.

I picked one experiment from Chapter 2 (ReAct + Tool Use). It requires OPENAI_API_KEY—set the env var per the README and a single inference loop runs cleanly. The minimal runnable version looks roughly like this:

# ai-agent-book Chapter 2 typical experiment: ReAct loop + single-tool call
import os
from openai import OpenAI

client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])

def get_weather(city: str) -> str:
    return f"{city} today is sunny, 25°C"

TOOLS = {
    "get_weather": get_weather,
}

SYSTEM = """你可以调用工具。格式:
Action: 
Action Input: 
Observation: """

def run_agent(question: str, max_steps: int = 5):
    messages = [
        {"role": "system", "content": SYSTEM},
        {"role": "user", "content": question},
    ]
    for step in range(max_steps):
        resp = client.chat.completions.create(
            model="gpt-4o-mini",
            messages=messages,
        ).choices[0].message.content
        print(f"Step {step}:\n{resp}\n")
        if "Action:" in resp and "Action Input:" in resp:
            obs = get_weather("北京")
            messages += [
                {"role": "assistant", "content": resp},
                {"role": "user", "content": f"Observation: {obs}"},
            ]
        else:
            break

run_agent("北京今天天气怎么样?")

Output shows Step 0 containing Action: get_weather and Action Input, then Step 1 produces the final answer. The skeleton of a ReAct loop is genuinely that small.

I didn't run all 103 experiments—3 to 5 per chapter, running the whole set would eat a weekend.

Overall impression: the content quality earns the 40k stars. It's a textbook plus lab manual, not an SDK.

Who Should Use It

Good fit:

  • Engineers who want systematic grounding in agent theory—more efficient than piecing together blog posts
  • Tech leads running team learning on agents—a Chinese book with matching experiments works as drop-in internal curriculum
  • Researchers or students needing multilingual agent material—14-language coverage is unusually broad
  • Content creators studying how to publish an open-source technical book—the content engineering and multilingual ops pipeline is a working template

Poor fit:

  • Anyone looking for a ready-made agent framework to ship in production—this isn't an SDK
  • Anyone wanting a single demo with zero ramp-up—103 experiments carry a real learning cost
  • Readers expecting code as heavily abstracted as LangChain's—the book's code stays closer to teaching examples and packs less abstraction

If you're building in the agent space, the book is worth at least a pass through Chapters 2 and 6—the former is the minimal practice of ReAct + Tool Use, the latter merges "asynchronous" and "multimodal" coverage and is the densest chapter in the 2.0 release.

Reference: bojieli/ai-agent-book GitHub repository

Source: https://github.com/bojieli/ai-agent-book