Track 01 · Models & contextLesson 04 of 10
ReAct, chain of thought and reflection in practice
The patterns behind every agent framework, and what each one multiplies.
- Lesson library · reference
- 40 min read
- 60 min hands-on
- Pro
What you'll be able to do
01- Explain chain-of-thought, zero-shot CoT, self-consistency, ReAct, plan-and-execute, Tree of Thoughts and Reflexion-style self-critique: what each adds, what it costs, and the evidence behind it.
- Recognise these patterns inside the frameworks, platforms and provider APIs a customer hands you, so you can reason about their behaviour and failure modes.
- Choose a pattern for a task using its cost multiplier and whether a checkable external signal exists.
- Implement a ReAct-style executor in which the model proposes and deterministic code owns tools, observations, budgets and the final grounding check.
- Diagnose common pattern failures: fabricated observations, loops, plans that go stale, and reflection that makes answers worse.
Before you start
- Tokens, context windows and why answers go wrong: next-token prediction and error compounding.
- Reasoning models and what thinking costs: native reasoning, and why not to prompt reasoning models for step-by-step thinking.
The short version
Most of what frameworks call "agents" is a handful of patterns with new names. Chain-of-thought writes intermediate steps before the answer. Self-consistency samples several reasoning paths and votes. ReAct interleaves thoughts with tool actions and real observations. Plan-and-execute plans first and runs steps with cheaper calls. Tree of Thoughts searches over reasoning branches. Reflexion and self-critique generate, evaluate and retry. Each buys something (intermediate work, diversity, contact with reality, structure, search, feedback) with tokens, calls and latency. Reasoning models have absorbed explicit step-by-step thinking, but acting through tools, planning across calls and checking against external signals remain your design choices. This file owns the patterns as ways the model reasons; the program around it (state, termination, step budgets) is the agent loop in The agent loop, written by hand.
- Every pattern is a way of spending tokens. Know the multiplier before you adopt it.
- ReAct's value is the observation, not the thought. Reasoning checked against real tool results beats reasoning in a vacuum.
- Critique needs an external signal. Tests, validators and evidence make reflection work; "are you sure?" often does not.
- The model proposes; deterministic code executes. Tools, arguments, observations and budgets are owned by your code.
- With reasoning models, drop explicit CoT; keep acting, planning and checking.
Pro lesson
The rest of this lesson is in Pro.
The mental model, worked example, field note, failure table, exercise and self-check, with the voice tutor.
- Every stage and specialisation, in full
- Every lab and every role project
- Halden weeks 2–10, on your record
- Every drill, live in the playground
- All solutions, plus the server judge
- Lab Assistant and every Teach with AI