# The 30-Agents repository is the lab bench for a book of agent architectures

> PacktPublishing's repository for 30 Agents Every AI Engineer Must Build ships 17 chapters of Jupyter notebooks, each in five provider variants, and every chapter runs without an API key on a built-in mock model. It is a companion codebase with working code, an errata log and no tagged releases, which shapes who should adopt it and how.

**PacktPublishing/30-Agents-Every-AI-Engineer-Must-Build** — 30 Agents Every AI Engineer Must Build, published by Packt

- Repository: https://github.com/PacktPublishing/30-Agents-Every-AI-Engineer-Must-Build
- Stars: 866 · Forks: 376
- Language: Jupyter Notebook
- License: MIT
- Published: 2026-10-20 · Updated: 2026-10-20 · Language: en
- Canonical page: https://hysenlabs.com/projects/packtpublishing-30-agents-every-ai-engineer-must-build

## Seventeen chapters, each a directory of notebooks

The repository is the companion code for the book 30 Agents Every AI Engineer Must Build, published by Packt in 2026 and written by Imran Ahmad, PhD, who is also the author of 50 Algorithms Every Programmer Should Know.

The book presents 30 agent architectures, and the repository carries the code for them across 17 chapter directories named chapter01 through chapter17. The primary language recorded for the repository is Jupyter Notebook, which is the right way to read that: this is a set of notebooks with prose, code cells and saved outputs rather than a Python package with an importable API.

The subject matter is agent systems. The README describes the shift from passive, reactive systems to autonomous, goal-directed agents that perceive their environment, make decisions and act with minimal human intervention, and it frames the book's value around the claim that a raw LLM alone is not enough. What the architectures have in common is that they decompose complex tasks, connect to external tools and data sources, maintain memory across interactions, collaborate with humans and other agents, learn from experience, and make decisions aligned with human values.

Each chapter is described as containing working code, formal architectural patterns, real-world case studies and guidance on common implementation pitfalls, with the patterns said to be tested against latency, cost, reliability and security.

The intended readers are AI engineers, software developers, ML researchers and technical leads who are deploying LLM applications or moving from traditional machine learning to agentic systems, with Python experience and basic ML knowledge recommended.

## Simulation mode removes the API key from the critical path

The most consequential design decision in the repository is the one that decides whether you can try any of it: no API key is required.

The requirements table states it plainly. API keys are not required, because every chapter runs in Simulation Mode with built-in MockLLM responses. An OpenAI, Anthropic or Google key enables Live Mode, and local Ollama requires no key at all.

That is a real difference from most agent examples, which typically ship a call to a hosted model in the first cell and leave the reader to sign up for an account before anything runs. Here the default path is a mock model with built-in, chapter-derived responses, so the architecture is the thing under examination rather than the API behaviour, and the notebook runs offline.

The mock responses are described as chapter-derived, which is the detail that makes simulation mode useful rather than decorative. If the canned outputs were generic, the notebook would teach nothing about the pattern. Generated from the chapter's own content, they give the surrounding cells something plausible to work with, so the code path is exercised end to end even though no model is called.

Every notebook is also pre-executed with its outputs saved, which the README points out means you can browse the results directly on GitHub without running any code. For a book with 17 chapters and five variants each, that is the difference between skimming and studying.

## Five notebook variants, one cell structure

Each chapter ships five notebook variants, and you pick the one that matches your setup. The table in the README lists them by suffix.

The suffix __RUN_NO_KEY_SIMULATION uses no provider, no API key and built-in mock responses. The __RUN_OPENAI_GPT4o variant uses OPENAI_API_KEY with GPT-4o or GPT-4o-mini, __RUN_CLAUDE_Sonnet4 uses ANTHROPIC_API_KEY with Claude Sonnet 4, and __RUN_GEMINI_Flash25 uses GOOGLE_API_KEY with Gemini Flash 2.5. The fifth, __RUN_LOCAL_OLLAMA_DeepSeek_V2_16B, uses no key at all and runs DeepSeek V2 16B with Llama 3.1 8B embeddings locally.

The claim about the variants is that all five produce equivalent pedagogical output with identical cell structure. That is the design that makes the choice painless: you are not choosing between different examples, you are choosing which model answers, and the code you read is the same in every case.

That equivalence is also the point to check yourself. The README does not publish the outputs side by side, so the claim is the author's. If a pattern's behaviour depends on how a model phrases something, the difference between a mock and a live model will show up there, and reading the same cell across two variants is how you would find out.

A related document sits at the top of the repository: LLM_COMPARISON_SUMMARY.md, which the README describes as head to head results across all 17 chapters with Bloom's taxonomy analysis, visualisations and per-domain recommendations. It is the place to look when you want to know how the different providers behaved on the same patterns.

## Running a chapter: clone, install, launch

The Quick Start section gives the exact commands for one chapter, and the steps are the same for every chapter.

```bash
# Clone the repository
git clone https://github.com/PacktPublishing/30-Agents-Every-AI-Engineer-Must-Build.git
cd 30-Agents-Every-AI-Engineer-Must-Build

# Navigate to a chapter
cd chapter05

# Install base dependencies
pip install -r requirements.txt
```

The provider specific dependencies come next, one file per provider, and you install the one matching the notebook you intend to open:

```bash
pip install -r requirements-openai.txt    # For OpenAI GPT-4o
pip install -r requirements-claude.txt    # For Anthropic Claude Sonnet 4
pip install -r requirements-gemini.txt    # For Google Gemini Flash 2.5
pip install -r requirements-ollama.txt    # For local Ollama (no API key)
```

If you want Live Mode, the environment file is copied from a template and one key is set:

```bash
cp .env.template .env
# Set ONE of: OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_API_KEY
```

Then the notebook is launched with Jupyter:

```bash
jupyter notebook ch05_foundational_architectures.ipynb
```

The environment requirements are modest and are listed in a table. macOS, Windows or Linux, Python 3.10 or later, 8 GB of RAM as a minimum with 16 GB recommended, and the tools you would expect: git, a terminal and a virtual environment tool such as venv, conda or uv. A GPU with CUDA 12 or newer is recommended but not required.

The Ollama path is the one for staying entirely on your own machine, and the README gives the pulls:

```bash
ollama pull deepseek-v2:16b
ollama pull llama3.1:8b
```

That path wants 16 GB of RAM or more, and chapter01 holds a LOCAL_LLM_SETUP.md with step-by-step instructions for Windows, macOS and Linux.

## What the chapters cover, and how the book is organised

The table of contents starts with Part 1, Agent Foundations and the Engineering Toolkit, whose stated job is to build the conceptual and practical foundation for designing, developing and deploying agent systems, and to establish the vocabulary and discipline that separate principled agent development from ad hoc prompt engineering.

Chapter 01 is Foundations of Agent Engineering, covering the evolution from rule-based to LLM-powered agents, cognitive architecture, the agent development lifecycle and a progression framework. Chapter 02 begins the next topic, which the visible text truncates, and the remaining fifteen chapters are not described in the part of the README available here, so it is not possible to say from the visible text what each of them contains.

That is a limitation worth stating plainly rather than papering over. The repository listing shows the chapter directories exist, and the README promises case studies and pitfalls per chapter, but the detailed syllabus lives in the table of contents and in the book itself.

The supporting files at the top level tell you what else is in the box. There is an ERRATA.md file and an Errata directory, an outline.docx that is presumably the book outline, and a supporting directory. The errata setup is the one most worth knowing about, because a book with 17 chapters of working code accumulates corrections, and the repository is the place they are recorded.

## Why this repository and not a book alone

There is a fair question about why any of this needs a repository, and the answer is visible in the structure of the deliverable.

An architecture pattern for an agent is mostly prose. What makes it usable is the code that shows the pattern wired up: how the task is decomposed, where the memory lives, how a tool call is issued and how the result comes back. A chapter that only describes that is a chapter you cannot run.

This repository takes the opposite approach to most architecture books, where the code samples are short enough to retype and are often simplified to the point of not running. Here the deliverables are full notebooks per chapter, in five provider variants, pre-executed with saved outputs and organised by directory with their own requirements files.

The difference in approach is what you can do with it. With a book you read. With this you read and then change one cell and see what happens, in a simulation that needs no account and no spend, or against a live model when you want to see real behaviour. The five-variant structure is what makes the second option cheap, because the same notebook works with whichever provider you have access to.

The limitation of that choice is that the code is teaching code. There is no package to install, no version to pin, no tagged releases, and the repository is the artefact of a 2026 publication rather than a maintained library. The MIT licence and the open errata log make it usable to learn from and to copy from, which is what it is for.

## Conclusion

Adopt this repository if you are learning agent architecture and want runnable code for each pattern, with the option to read the pre-executed notebooks on GitHub without installing anything. Do not adopt it as a production framework, since it is a book's example code with no releases, no package and a stated 2026 vintage. Before you start, read ERRATA.md and the Errata directory, since errata for a book of this size accumulate, and decide first whether Simulation Mode is enough for your learning goal or whether you need the Live Mode or Ollama variants, because the five notebook variants share an identical cell structure and differ only in provider, key and model.

## FAQ

### Do I need an API key to run the 30-Agents notebooks?

No. The README states that API keys are not required, because every chapter runs in Simulation Mode with built-in MockLLM responses. An OpenAI, Anthropic or Google key unlocks Live Mode, and the local Ollama variant needs no key and makes no cloud calls.

### What Python version and hardware do the 30-Agents notebooks need?

Python 3.10 or later on macOS, Windows or Linux, with 8 GB of RAM as a minimum and 16 GB recommended. An NVIDIA GPU with CUDA 12 or newer is recommended but not required, and the Ollama path asks for 16 GB of RAM or more.

### How do I run a single chapter from the 30-Agents repository?

Clone the repository, change into the chapter directory such as chapter05, run pip install -r requirements.txt, add the provider requirements file you need, and launch the notebook with jupyter notebook. Copying .env.template to .env and setting one key is only needed for Live Mode.

### What is the difference between the notebook variants in 30-Agents?

Each chapter ships five pre-executed notebooks with identical cell structure, differing in provider, key and model: a no-key MockLLM simulation, OpenAI GPT-4o, Anthropic Claude Sonnet 4, Google Gemini Flash 2.5 and a local Ollama variant using DeepSeek V2 16B with Llama 3.1 8B embeddings.

## Sources

- [Issues](https://github.com/PacktPublishing/30-Agents-Every-AI-Engineer-Must-Build/issues)
- [License: MIT](https://github.com/PacktPublishing/30-Agents-Every-AI-Engineer-Must-Build/blob/main/LICENSE)
- [PacktPublishing/30-Agents-Every-AI-Engineer-Must-Build on GitHub](https://github.com/PacktPublishing/30-Agents-Every-AI-Engineer-Must-Build)
- [README](https://github.com/PacktPublishing/30-Agents-Every-AI-Engineer-Must-Build/blob/main/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/packtpublishing-30-agents-every-ai-engineer-must-build
