Chapter 11 · Agent Architectures

Different problems need
different thinking.

Six shapes of thought — ReAct, Chain-of-Thought, Plan & Execute, Tree of Thoughts, Reflection, and LATS — and when to reach for each.

The idea

Architecture is how you structure an agent's reasoning.

Same model, same tools — but you choose the shape of thought it runs on. A loop? A straight line? A branching tree? That choice is the architecture.

Knowing these separates dabblers from builders.

Anyone can prompt a model. Picking the right reasoning pattern for the problem in front of you is the craft.

The gallery

Six reasoning shapes.

Each pattern trades simplicity, cost, and power differently. We'll walk them from cheapest and simplest to the heavy machinery you only wheel out when a problem earns it.

ReAct

Reason + act, on a loop.

Chain-of-Thought

Think step by step.

Plan & Execute

Plan first, then do.

Tree of Thoughts

Explore many paths.

Reflection

Try, critique, retry.

LATS

Search the whole tree.

Pattern 1

ReAct — reason, act, observe, loop.

Think Act Observe

The workhorse. Think, act (call a tool), observe the result, and loop — reasoning before every move. It never needs the whole path in advance, so it adapts as it goes.

Best for
General tasks where the path isn't predictable
Cost
Low

Pattern 2

Chain-of-Thought — think step by step.

step 1 step 2 step 3 answer

Force the model to verbalise its whole reasoning before answering — "let's think step by step." Articulating each step dramatically improves accuracy on problems that need multi-step logic.

Best for
Math, logic puzzles, multi-step reasoning
Cost
Low

Pattern 3

Plan & Execute — plan first, then do.

Make a plan execute 1 execute 2 execute 3

Two phases: build a complete plan up front, then execute each step in order. Great when you know the shape of the solution — but a rigid plan can go stale if something unexpected happens mid-run.

Best for
Predictable, well-understood workflows
Cost
Low–medium

Pattern 4

Tree of Thoughts — explore many paths.

best path

Instead of one line of reasoning, branch out and explore several approaches at once, evaluate each branch, and follow the most promising — like a chess player weighing multiple moves.

Best for
Creative & strategic problems with many options
Cost
High

Pattern 5

Reflection — try, critique, retry.

Attempt Result Reflect ✗ ✓ done

Attempt the task, look at the result, explicitly reflect on what went wrong and why, then try again with that lesson in mind. Self-improvement through failure.

Best for
Coding, math — anything you can run and verify
Cost
Medium

Pattern 6

LATS — search the whole tree.

0.4 0.8 0.2 0.6 0.9 highest-value path wins

Language Agent Tree Search combines tree search — like a game-playing AI — with ReAct and Reflection: explore a tree of actions, score each branch, and learn from failures. Expensive and complex, but powerful.

Best for
High-stakes optimization problems
Cost
Very high

The trade-off

Power costs compute. Climb only as high as you must.

The same six patterns, lined up by what they cost to run:

  • CoTlow
  • ReActlow
  • Plan & Execlow–med
  • Reflectionmedium
  • Tree of Thoughtshigh
  • LATSvery high

Every rung up buys more exploration — and more tokens, latency, and dollars.

In the real world

Most production systems: ReAct + a dash of Reflection.

Simple enough to be reliable, powerful enough to recover from surprises. That pairing covers the overwhelming majority of real agents you'll build.

ReAct is the engine

Loops through the task, adapting move by move.

Reflection is the safety net

Catches a bad result and retries smarter.

Escalate to ToT or LATS only when the problem earns it.

Chapter 11 in one breath

Pick the shape of thought to fit the task.

ReAct loops. Chain-of-Thought reasons in a line. Plan & Execute commits up front. Tree of Thoughts and LATS explore many paths. Reflection learns from failure. Start simple — ReAct plus Reflection covers most of it — and escalate only when the problem earns it.

Same model underneath; the architecture is the choice.

Next up

Chapter 12 · Multi-Agent Systems.

We've named six shapes of thought for a single agent. Next: what happens when one agent isn't enough — and many of them have to work together.

Press S for speaker notes · F for fullscreen · to advance.