
Section
Build
Designing an agent once the loop runs: its shape, its tools, its replies, its context, and what it knows.
Each design page names the problem, shows the design in Go, and says what the design cost in tokens, money, and turns across the book’s recorded runs, with a short list of when to reach for it and when to leave it out. Where a page uses goroutines, channels, or iterators, it explains them in a line, and the deeper passages sit in collapsible “Under the hood” panels you can skip on a first read.
Show guides by loop stage
On the agent compass
No guides here work on this stage alone.
Covers every stage
Part 1
Start building
- Build your first agentA complete agent in a few short files of standard-library Go, run offline and then on your own files.Beginner
- Workflow or agent?Five shapes of program that call a model, and how to pick the simplest one that handles the task.Beginner
- Patterns by nameReAct, chaining, routing, reflection, orchestrator-workers, and the rest, each mapped to Go code and measured runs.Intermediate
Part 2
Tools and output
- Designing toolsWhat the model sees of a tool, and how to write names, schemas, results, and errors it uses well.Intermediate
- Streaming repliesReading a reply that arrives as it is written (server-sent events) in Go, and rebuilding tool calls from fragments.Intermediate
- Structured outputGet a typed, checked answer from any tool-calling model by making the answer a final tool.Intermediate
Part 3
Scale up
- Context managementFive ways to keep a long run affordable and on task, and what each did on a 99-report batch.Intermediate
- Parallel tool callsWhich tool calls can safely overlap, a runner that keeps the model’s order, and what it saves.Intermediate
- Sub-agentsRun your agent loop again inside a tool to answer one question, and when that doesn’t pay off.Intermediate
- MCP in GoThe Model Context Protocol on the wire, a Go client for it, and how far to trust another program’s tools.Intermediate
Part 4
Knowledge and memory
- RAG in GoSplit documents into chunks, embed them, search in memory, and answer from what the search found.Intermediate
- RAG or agentic search?One-shot RAG, search as a tool, and an agent reading files, measured on the same 16 questions.Intermediate
- Memory between sessionsNotes an agent saves, replaces, and recalls by meaning, measured against no memory and the whole history.Intermediate

