A code-first book about useful autonomy

Agentic Engineering
from First Principles

Building, Controlling, and Scaling LLM Agents in Practice

Build the smallest possible agent. Run it. Break it deliberately. Then engineer the failure.

For leaders: Agentic Engineering for Executives, a free briefing: the questions to ask before you approve an agent (PDF).

30chapters
59experiments
1tiny agent kernel
Cover of Agentic Engineering from First Principles
CONCEPT→CODE→RUN→BREAK→ENGINEER→PATTERN→SCALE
The central model

Strip away the terminology.

An agent is a software system in which a model participates in decisions that can affect an environment. Most of the field can be understood through five components.

Agent = Model + Context + Actions + State + Control
01

Model

Proposes decisions. It is a component, not the whole system.

02

Context

The information selected and made visible for the current decision.

03

Actions

Capabilities whose consequences can change an external environment.

04

State

What persists: working state, memory, artifacts, checkpoints and experience.

05

Control

What may happen, how execution proceeds, what resources are available, and when it stops.

THE CONTROL LAWAutonomy ↑  ⇒  Control Requirements ↑

The objective is not maximum autonomy. It is useful autonomy under appropriate control.

The journey

30 chapters. Six parts.

Start with one model call and progressively add abilities, reasoning, collaboration, reliability, and advanced autonomy. Browse every chapter: question, lecture, principle and experiments →

Video lectures

Watch the course.

A narrated lecture for every chapter, built from the book's own slides. Pick a chapter to watch it here.

Executable learning

59 experiments. One question at a time.

Every experiment isolates a mechanism, creates a failure, and turns the failure into an engineering lesson. Try them in the Lab: replay a recorded real run of any experiment and watch, step by step, what the model and the agent do. No programming or API key needed.

No magic

The smallest useful agent fits on one screen.

Every experiment calls a real model through a visible control loop, and all 59 also have runnable LangChain and LangGraph implementations.

  • Provider-neutral model interface
  • Explicit tool execution
  • Bounded steps and stopping
  • Real model calls, printed with a recorded run
  • Primitive → Engineered → Framework
View companion code on GitHub

Browse framework examples · Installation and run guide · Live-model experiments

agentic/agent.py
class Agent:
    def run(self, goal):
        messages = [{"role": "user",
                     "content": goal}]

        for step in range(self.max_steps):
            decision = self.model.generate(messages)
            messages.append({"role": "assistant",
                             "content": decision})

            if decision.get("done"):
                return decision["answer"]

            observation = execute(decision,
                                  tools=self.tools)
            messages.append({"role": "tool",
                             "content": str(observation)})

        raise RuntimeError(
            "Step limit reached"
        )
The complete book

All 30 chapters.
Yours to explore.

Download the complete 602-page PDF: every experiment printed in full with its real output, a briefing for executives, more than 200 drawn figures, LangChain and LangGraph examples, recorded runs on real models, a glossary, a bibliography and an index, on the full journey from a model call to controlled autonomy.

Free, with no sign-up. You can also read Chapter 1 on its own, or the executive briefing, Agentic Engineering for Executives.

Get the full PDF

The complete book, 602 pages. No email needed.

Download the full PDF
Newsletter

Stay close to the work.

Occasional emails when new chapters, editions, experiments, or companion code are published, plus practical notes on engineering agents that stay under control. No spam; unsubscribe in one click.

  1. Enter your email address.
  2. Confirm using the link in your inbox.
  3. That's it: you're subscribed.

Subscribe to updates

We'll send one confirmation email before adding you.

You join only after confirming your email. Privacy details.

Checking newsletter availability…

Principles revealed by the experiments

More is not automatically better.

More Context ≠ Better Context
More Reasoning ≠ Better Answers
More Memory ≠ Better Memory
More Agents ≠ Better Intelligence
More Autonomy ≠ Better Systems
Adaptation ≠ Improvement
Outcome Quality ≠ Trajectory Quality
Capability ≠ Permission
Consensus ≠ Truth
Christiaan van der Walt
About the author

Christiaan M. van der Walt, PhD

Christiaan van der Walt is an engineer, machine learning researcher, and technology leader with nearly two decades of experience developing AI systems from first principles and bringing them into production. He currently leads Advanced Analytics within Momentum Group’s Group Technology structure. His work spans generative AI, recommendation systems, predictive analytics, and patented digital fitness assessment technology.

His earlier career includes several years as a machine learning researcher at the Council for Scientific and Industrial Research (CSIR), where he developed algorithms and systems across speech processing, biometrics, security, and environmental modelling. He also completed a research internship at IBM’s T.J. Watson Research Center in New York, working on automatic speech recognition and speech-driven information retrieval.

Christiaan holds a PhD specialising in machine learning from North-West University and engineering degrees from the University of Pretoria. His research includes contributions to density estimation and pattern recognition, with publications at conferences including AAAI and ICASSP. His experience combines mathematical foundations, hands-on software development, research, and the practical demands of deploying AI in real organisations.

Connect with me on LinkedIn

Start at the beginning

Build the smallest possible agent.
Then break it.

59 executable experiments. One tiny agent kernel. No magic.