@0xGky: O'Reilly 出的那本《AI Agents - The Definitive Guide》 配套代码已经挂出来了:12 章,统共 35 个 Notebook。打 ReAct、思维树、多 Agent 这几样起步,一路铺到记忆、评测、成本…
摘要
O'Reilly《AI Agents - The Definitive Guide》的配套代码仓库已上线,包含12章共35个Jupyter Notebook,覆盖ReAct、思维树、多智能体、记忆、评测、成本与威胁建模,且每个Notebook都配有可直接运行的Colab链接。
查看缓存全文
缓存时间: 2026/11/24 23:33
O’Reilly 出的那本《AI Agents - The Definitive Guide》
配套代码已经挂出来了:12 章,统共 35 个 Notebook。打 ReAct、思维树、多 Agent 这几样起步,一路铺到记忆、评测、成本、安全。
每个 Notebook 的 Colab 都替你配妥了,浏览器一点开就能跑起来,本地环境连碰都不用碰。
收尾还另起一章,单讲 Agent 的威胁建模,当练手的材料正得用。 🔗 https://github.com/Nicolepcx/ai-agents-the-definitive-guide…
Nicolepcx/ai-agents-the-definitive-guide
Source: https://github.com/Nicolepcx/ai-agents-the-definitive-guide
⭐ If you find this repository helpful, please consider giving it a ⭐ here on GitHub (click the star button in the top right corner) It’s a quick way to show support for this openly available code. ⭐

AI Agents - The definitive Guide
This is the corresponding code for the book AI Agents - The Definitive Guide the book can be found here and on Amazon. The book has an accompanying website with quizzes and additional material, as well as a Discord channel.
TOC
- Chapter 1 From LLMs to Agents: The Foundational Blueprint
- Chapter 2 Architectures and Patterns: Planning, Reactivity, and Multi-Agent-Systems
- Chapter 3 Advanced Planning, Reasoning, and Scalable Execution in Agents
- Chapter 4 Models Behind the Agents: Capabilities and Optimization
- Chapter 5 From Prototypes to Production: Contracts, Tools, and Reliable Execution
- Chapter 6 Secure Execution and Tool Governance
- Chapter 7 Deploying Agents in Real Products
- Chapter 8 Foundational Evaluation and Operational Observation of Agentic Systems
- Chapter 9 Customized and Advanced Evaluation of Agentic Systems
- Chapter 10 Agent Memory: How Persistence Turns Agents Into Evolving Systems
- Chapter 11 From Compute to Cost: Designing Efficient Agentic Systems
- Chapter 12 Threat Modeling for AI Agents
Instructions and Navigation
All of the code is organized into folders. Each folder starts with CH followed by the chapter number. For example, CH01.
The notebooks are then organized as follows: ch01_attention_mechanism_variations.ipynb, where ch01 indicates the chapter
and attention_mechanism_variations what is done in the notebook.
Repo structure
├── LICENSE
├── README.md <- The top-level README for developers using this project.
├── CH01 <- Per chapter folder with Jupyter notebooks.
├── [name].ipynb <- Jupyter notebooks with naming as mentioned above.
├── CH02 <- Per chapter folder with Jupyter notebooks.
... <- Same structure for all chapters.
├── utils <- Custom classes and functions and utility functions.
├── resources <- Some miscellaneous resources.
Running the Notebooks
Every notebook can be opened and run on Google Colab directly from the links below. Just click the Open In Colab badge next to the notebook you want to run.
Chapter 1 — From LLMs to Agents: The Foundational Blueprint
| Notebook | Colab |
|---|---|
| Code Examples |
Chapter 2 — Architectures and Patterns: Planning, Reactivity, and Multi-Agent-Systems
| Notebook | Colab |
|---|---|
| Chain-of-Thought (CoT) | |
| Tree-of-Thought (ToT) | |
| ReAct | |
| Human-in-the-Loop (HITL) | |
| Hierarchical Agent Teams | |
| Swarms |
Chapter 3 — Advanced Planning, Reasoning, and Scalable Execution in Agents
| Notebook | Colab |
|---|---|
| ART + RULER | |
| RULER Cat Poems | |
| TreeQuest (AB-MCTS) |
Chapter 4 — Models Behind the Agents: Capabilities and Optimization
| Notebook | Colab |
|---|---|
| Supervisor Agent Team |
Chapter 5 — From Prototypes to Production: Contracts, Tools, and Reliable Execution
| Notebook | Colab |
|---|---|
| Deep Agents | |
| MCP with LangGraph | |
| Product Reliability Rule | |
| Pydantic Agent Consistency |
Chapter 6 — Secure Execution and Tool Governance
| Notebook | Colab |
|---|---|
| A2A + MCP Governed | |
| MCP Server with Composio | |
| LangGraph + E2B Sandbox | |
| Programmatic Tool Calling (Monty) |
Chapter 7 — Deploying Agents in Real Products
| Notebook | Colab |
|---|---|
| Hardening Backbone | |
| Inference Backends | |
| Model Fallback |
Chapter 8 — Foundational Evaluation and Operational Observation of Agentic Systems
| Notebook | Colab |
|---|---|
| OWASP ASI 2026 | |
| Evaluation Harness |
Chapter 9 — Customized and Advanced Evaluation of Agentic Systems
| Notebook | Colab |
|---|---|
| AgentVista | |
| External Evaluation Pipelines (Langfuse) | |
| External Evaluation Pipelines (LangSmith) | |
| RULER Trace Answer Ranking (LangSmith) |
Chapter 10 — Agent Memory: How Persistence Turns Agents Into Evolving Systems
| Notebook | Colab |
|---|---|
| Agent Memory with LangGraph | |
| Memory vs. No Memory | |
| Memory Topologies |
Chapter 11 — From Compute to Cost: Designing Efficient Agentic Systems
| Notebook | Colab |
|---|---|
| Agent Cost Estimator by Topology | |
| Memoizing Swarm Research Engine | |
| Memory Footprint, Throughput & GPU Requirements |
Chapter 12 — Threat Modeling for AI Agents
| Notebook | Colab |
|---|---|
| LlamaFirewall |
相似文章
@bkdgiffug: 如果您正在从事Agent开发,请将此资源保存以备后用。O'Reilly书籍*AI Agents - The Definitive Guide* h…
O'Reilly书籍《AI Agents - The Definitive Guide》已将其配套代码开源,包含12章和35个笔记本,涵盖AI代理开发主题,支持Colab,并有一章关于威胁建模。
@x5cnhp:Agent 开发者注意——这个免费福利机会一旦错过,你真的会后悔!那本 O'Re…
O'Reilly 的《AI Agents - The Definitive Guide》一书已将全部配套代码发布在 GitHub——12 章、35 个可直接在 Colab 上运行的 Jupyter notebook,涵盖 Agent 基础、多智能体协作、生产环境注意事项和威胁建模,无论你是否购买了该书,均可免费获取。
@tom_doerr: O'Reilly 的《AI Agents definitive guide》官方源代码 https://github.com/Nicolepcx/ai-agents-the-definitive-guide…
O'Reilly 的《AI Agents - The Definitive Guide》一书的官方源代码仓库,包含用于构建 AI agents 的 Jupyter notebooks 和工具。
@realchendahuang:GitHub 上出现了一个大型全栈 AI 工程开源教程,一口气拆解了 20 个阶段、523 个模块……
一个覆盖 20 个阶段、523 个模块的大型全栈开源 AI 工程教程出现在 GitHub 上,涵盖从线性代数、Transformer 到多智能体与生产部署的完整内容,并可一键安装为 Claude Code 或 Codex 的 Agent Skill,实现本地化的一对一辅导式学习。
@alacheng: 从零开始学 Agent,一个很不错的免费在线课程。不是简单的讲LLM API调用,而是涵盖记忆系统,多智能体,agentic RL等等,还包括一个小型agent的实践代码。深入浅出。 https://github.com/Haozhe-X…
开源的 AI Agent 双语教材「agent_learning」发布,23 章从零覆盖记忆系统、RAG、多智能体、Agentic RL 到生产部署,并附带可运行的参考 Agent 代码与测试。