AI Agents — The Definitive Guide (Companion Code)

Official companion repository for the O'Reilly book 'AI Agents - The Definitive Guide', with twelve chapters of runnable Jupyter notebooks covering everything from LLMs to production-grade agents.

Stars
★ 3k
Last updated
3mo ago
Primary language
Jupyter Notebook

At a glance

How it runs
Library / SDK
Works with
Universal · cross-platform
Cost
Free software; you pay for model usage
Setup effort
Low · running in minutes
You'll need
Google Colab or local JupyterLLM provider API keysNetwork accessMCP Server
Typical use
An engineer reading the book wants to run the companion code chapter by chapter in Colab to see how ReAct, hierarchical teams, and swarms behave in practice.
Not a fit if
  • Teams wanting a deployable agent product; this is teaching code only
  • Readers unwilling to sign up for E2B, Composio, Langfuse or LangSmith accounts
Website
oreilly.com ↗ set on GitHub
Maintenance
Commits in the last 6 monthslast commit 2026-08-01+8.1 ★/day over 7 days

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

This repository is the official code companion to the O'Reilly book 'AI Agents - The Definitive Guide', organized as Jupyter notebooks grouped into folders CH01 through CH12. Each chapter maps to a book topic: from LLM foundations and architecture patterns (CoT, ToT, ReAct, multi-agent teams, Swarms) through advanced planning and reasoning, productionization, secure execution and tool governance, evaluation and observability, agent memory, cost efficiency, and threat modeling. Every notebook ships with a one-click 'Open In Colab' badge, so readers can run examples without any local setup. The repo also includes a utils directory, a resources directory, and is backed by a companion book website with quizzes plus a Discord community. It is positioned as a learning and reference resource, not a deployable agent product.

The repository provides roughly thirty Jupyter notebooks named by chapter (e.g., ch02_CoT.ipynb, ch03_TreeQuest.ipynb, ch06_MCP_server_composio.ipynb), each demonstrating one concrete technique: Chapter 2 covers Chain-of-Thought, Tree-of-Thought, ReAct, Human-in-the-Loop, hierarchical agent teams, and swarms; Chapter 3 covers ART+RULER and TreeQuest (AB-MCTS); Chapter 5 covers Deep Agents, MCP with LangGraph, and Pydantic agent consistency; Chapter 6 covers governed A2A+MCP, an MCP server with Composio, LangGraph with E2B sandbox, and programmatic tool calling (Monty); Chapter 7 covers inference backends and model fallback; Chapters 8-9 cover an evaluation harness, OWASP ASI 2026, and Langfuse/LangSmith evaluation pipelines; Chapter 10 covers LangGraph agent memory and memory topologies; Chapter 11 covers cost estimation by topology plus GPU memory/throughput requirements; Chapter 12 covers LlamaFirewall. Code builds on the LangChain/LangGraph ecosystem and calls third-party services including E2B, Composio, Langfuse, LangSmith, and LlamaFirewall.

  1. An engineer reading the book wants to run the companion code chapter by chapter in Colab to see how ReAct, hierarchical teams, and swarms behave in practice.
  2. A team moving agent prototypes to production studies the Chapter 5-7 notebooks for Pydantic consistency checks, model fallback, and inference backend choices.
  3. A security team needs threat modeling and tool governance for agent systems, using the Chapter 6 MCP governance and E2B sandbox examples plus the Chapter 12 LlamaFirewall notebook.
  4. A platform team building an agent evaluation practice references the Chapter 8-9 evaluation harness, OWASP ASI 2026, and Langfuse/LangSmith pipeline examples.
  5. A technical lead sizing compute and cost for agentic systems uses the Chapter 11 cost estimator and GPU memory/throughput notebooks for capacity planning.
  6. A researcher compares how memory topologies affect agent behavior by running the Chapter 10 memory experiment notebooks.

How do you install or deploy this agent?

No local installation is required to run: every notebook in the README has an 'Open In Colab' badge that opens it directly in Google Colab. To run locally, clone the repo with git clone https://github.com/Nicolepcx/ai-agents-the-definitive-guide, install Jupyter plus the dependencies each notebook needs (the README provides no requirements.txt or pinned versions), and configure the required LLM provider and third-party service (E2B, Composio, Langfuse, LangSmith, etc.) API keys inside the notebooks.

How do you use this agent?

  1. Find the target chapter table in the README and click the Colab badge for a notebook (e.g., ch02_react.ipynb in Chapter 2); 2. Fill in API keys as instructed inside the notebook; 3. Run cells in order and inspect outputs. Notebooks are named CH-number plus topic, and the code depends on custom classes and functions in the repo's utils directory. Start with ch01_code_examples.ipynb for foundations, then dive into later chapters as needed.

What are this agent's strengths and limitations?

Pros
  • Maps one-to-one to a published O'Reilly book, with a twelve-chapter structure covering the full agent engineering spectrum from foundations to threat modeling.
  • All notebooks run with one click in Colab, so examples are reproducible with zero local configuration.
  • Examples are current with the ecosystem, covering MCP, A2A, Deep Agents, E2B sandbox, LlamaFirewall, and OWASP ASI 2026.
  • Backed by a companion website with quizzes and additional material, plus an active Discord channel.
Limitations
  • It is a teaching codebase, not a deployable product — there is no unified dependency manifest or version pinning, so local reproduction requires solving dependencies yourself.
  • Many notebooks depend on third-party paid or registration-gated services (E2B, Composio, Langfuse, LangSmith), adding account and key-management overhead to run everything.
  • The license type is not stated in repository metadata; confirm the LICENSE file's terms before commercial or internal-training reuse.
  • Code is tightly coupled to fast-moving LangChain/LangGraph APIs, so notebooks may need adaptation as the ecosystem evolves.

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
AI Agents — The Definitive Guide (Companion Code) This agent 34 · Major gaps Library / SDKFree + model costs ★ 3k 3mo ago Jupyter Notebook —
AI Agent Engineering Textbook 60 · Some gaps FrameworkFree ★ 682 24d ago HTML —
Agent Systems Handbook 62 · Some gaps Web appFree ★ 314 1mo ago MDX —
Generative AI with LangChain 41 · Major gaps Library / SDKFree + model costs ★ 1.5k 3mo ago Jupyter Notebook OpenAI API · Claude API

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
34/ 100 5-point scale 1.7 / 5
Trust 8/29
Reliability 3/14
Adaptability 9/18
Convention 5/18
Effectiveness 7/13
Verifiability 2/8
Why each dimension lost points
Trust8 / 29 · 1.4/5

The README describes chapter-organized agent examples and lists topics including HITL, tool governance, secure execution, and threat modeling, but the supplied material does not show concrete permission scopes, sensitive-data handling, confirmation for external side effects, dependency security, or recovery mechanisms. Those criteria receive 1 only for topic-level or basic documentation evidence; rollback receives 0 because no recovery mechanism is shown. The README points to a book, companion site, and Discord, but does not establish code provenance or maintainer identity, so source attribution receives 1.

Reliability3 / 14 · 1.1/5

The README gives a chapter structure and example index, providing partial evidence of product organization. The sample contains no code, dependency manifest, error handling, or failure messages, so self-consistency and dependency availability receive 1, and failure messages receive 0.

Adaptability9 / 18 · 2.5/5

The twelve-chapter outline spans foundational patterns, production deployment, evaluation, memory, cost, and threat modeling, supporting a broad set of use cases and earning 2. The README does not clearly define example capability boundaries, earning 1. Chapter and notebook topics make example selection reasonably clear, earning 2 for trigger precision. Run guidance mainly points to Google Colab and does not specify local or other environment requirements, so environment fit receives 1.

Convention5 / 18 · 1.4/5

The README provides a table of contents, chapter mapping, and notebook naming guidance, earning 2 for information architecture. Colab badges offer limited startup guidance, earning 1 for install notes. Naming guidance exists, but capitalization and directory forms vary across examples, earning 1 for naming stability. The chapter index and example listing are useful, though there is no FAQ, earning 2. No known limitations, license text, version, or changelog are shown; LICENSE appears only in the structural outline, so license receives 0. The README does not identify a maintainer or update path, earning 1 for maintenance responsibility.

Effectiveness7 / 13 · 2.7/5

Chapter indexes, notebook titles, and Colab links help readers locate and open examples, earning 2 for output usability. Coverage across agent patterns, deployment, governance, and evaluation adds value beyond a single-topic example set, earning 2 for marginal value. There is no overall account of runtime or resource costs, so cost-benefit receives 1.

Verifiability2 / 8 · 1.3/5

The README gives partial traceability between the book, chapters, and notebooks, earning 1 for claim traceability. Only the README is supplied, with no code or tests for independent corroboration, earning 0 for cross-source corroboration. It identifies the repository as companion code and lists its structure, but does not distinguish documented examples from validated capabilities or explain their limits, earning 1 for fact-inference separation.

Risks and how to mitigate them
  • Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
  • This assessment uses only the supplied README sample. Unprovided files are unknown, and no notebook execution or independent verification is claimed.
  • The README lists a LICENSE file but does not provide its contents, so usage and redistribution terms cannot be confirmed from this material.
  • Colab links point to the repository's main branch while the review targets a pinned revision; the links alone do not establish the pinned revision's contents or runnability.
Evidence confidence: Low Reviewed Nov 08, 2026 Reviewed revision a1ff481c87cc
Review evidence README.md
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-agents-the-definitive-guide.svg)](https://followagents.com/en/agents/ai-agents-the-definitive-guide)
<a href="https://followagents.com/en/agents/ai-agents-the-definitive-guide"><img src="https://followagents.com/badge/ai-agents-the-definitive-guide.svg" alt="FARS review"></a>

FAQ

Is AI Agents — The Definitive Guide (Companion Code) free?
The software is free, but AI Agents — The Definitive Guide (Companion Code) calls an AI model, and you pay that model provider for usage (or run a local model).
Is AI Agents — The Definitive Guide (Companion Code) open source?
The source code is public on GitHub (Nicolepcx/ai-agents-the-definitive-guide), but the repository does not declare a recognised licence, so the rights to reuse or modify it are unclear. Ask the author or check the README before building on it.
Is AI Agents — The Definitive Guide (Companion Code) safe to use?
FollowAgents' FARS review (Nov 08, 2026) scored AI Agents — The Definitive Guide (Companion Code) 8/29 on trust and safety. The review did not find these safety controls in the source: rollback or recovery path. Before giving it real accounts or data: Back up first, or work on a git branch or snapshot, so its changes can be undone.
Is AI Agents — The Definitive Guide (Companion Code) still maintained?
Development has slowed: the latest commit on GitHub is from 2026-08-01, within the last six months but not the last 30 days.
Who makes AI Agents — The Definitive Guide (Companion Code)?
AI Agents — The Definitive Guide (Companion Code) is published on GitHub by the account Nicolepcx. FollowAgents has not verified which person or company is behind that account.
What is AI Agents — The Definitive Guide (Companion Code)'s official website?
The project's GitHub repository lists https://www.oreilly.com/library/view/ai-agents-the/0642572247775/ as its website. That link is set by the repository owner; the source code itself is on GitHub (Nicolepcx/ai-agents-the-definitive-guide).
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