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.

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.

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.

No magic

The smallest useful agent fits on one screen.

Start with a visible control loop, then compare all 59 experiments with runnable LangChain and LangGraph implementations.

  • Provider-neutral model interface
  • Explicit tool execution
  • Bounded steps and stopping
  • Deterministic examples before empirical benchmarks
  • Primitive → Engineered → Framework
View companion code on GitHub

Browse framework examples · Installation and run guide

agent.py
class Agent:
    def run(self, goal):
        messages = [goal]

        for step in range(10):
            decision = self.model(messages)

            if decision.done:
                return decision.answer

            result = self.tools[
                decision.tool
            ](**decision.arguments)

            messages.append(result)

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

All 30 chapters.
Yours to explore.

Download the complete 381-page PDF, including the cover, first-principles and framework examples, and the full journey from a model call to controlled autonomy.

  1. Enter your email address.
  2. Confirm it using the link in your inbox.
  3. Download the complete book.

You can still read Chapter 1 immediately.

Get the full PDF

We’ll send you a verification link. Book updates are optional.

We use your email to verify access. Only readers who select the checkbox and confirm their email join the mailing list. Privacy details.

Checking download 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 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.