Browse
All guides
Every guide on the site in one list, grouped by section, with each guide’s loop stage and skill level, and a filter that shows only the guides for one stage of the loop.
Each guide works on one stage of the agent loop, or on the whole loop, and has a skill level: beginner, intermediate, or advanced. Pick a stage to see its own guides first, then the guides that cover the whole loop. Guides that belong to no single stage, such as setup and comparison pages, show under All.
Show guides by loop stage
No guides here work on this stage alone.
Covers every stage
Basics
- Getting set up Go 1.27, the companion code, offline and live runs, and the newer Go features the code uses.Beginner
- What an agent is What makes a program an agent, followed through one run that fixes a failing test.Beginner
- The agent loop The whole agent loop in about 30 lines of Go, read stage by stage.Beginner
- Your first model call An API key, one request with curl, and every part of the reply, including what it cost.Beginner
- Messages and roles The four roles in a conversation, the Go type that holds them, and how to write a system prompt.Beginner
- Calling a model from Go A chat completions client in standard-library Go, with deadlines, error checks, and finish reasons.Beginner
- Common first errors A missing key, no credit, a bad model ID, rate limits, cut-off replies, and two Go traps.Beginner
- Tool calling on the wire A tool call as raw JSON, how a Go client sends and reads one, and the rules that keep it valid.Beginner
- Tokens, cost, and context How an agent’s requests grow each turn, what a run costs, and why the context window misleads.Beginner
- How models pick the next token A toy model in Go shows why answers vary, what temperature does, and why a tool call is text.Beginner
- Choosing a model Tool support, cost per finished task, reasoning models, local models, and how to compare.Beginner
Go in depth
- context.Context in an agent Stop a run, give each call a deadline, say why it stopped, and let the work that must finish still finish.Intermediate
- Errors in an agent Errors for two readers: the program, which decides what to do, and the model, which fixes its next call.Intermediate
- JSON v2 for model APIs What changed from encoding/json, and the parts of v2 an agent leans on, each checked in Go 1.27.Intermediate
- An HTTP client for model APIs One shared client, deadlines on the context, size limits, errors inside a 200, and honoring Retry-After.Intermediate
- Streams in Go Reading and writing a stream in Go: io.Reader, bufio.Scanner, server-sent events, and flushing.Intermediate
- Goroutines with an owner Start goroutines with an owner and a way to stop, merge their results, and prove none is left behind.Intermediate
- Iterators in an agent Streams and runs as iterators: yield, break, cleanup in a defer, and the mistakes that panic.Intermediate
- Commands and files Run go test so it stops when told, keeps your keys, and reports what failed; keep file tools inside one directory.Intermediate
Build
- Build your first agent A 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 name ReAct, chaining, routing, reflection, orchestrator-workers, and the rest, each mapped to Go code and measured runs.Intermediate
- Designing tools What the model sees of a tool, and how to write names, schemas, results, and errors it uses well.Intermediate
- Streaming replies Reading a reply that arrives as it is written (server-sent events) in Go, and rebuilding tool calls from fragments.Intermediate
- Structured output Get a typed, checked answer from any tool-calling model by making the answer a final tool.Intermediate
- Context management Five ways to keep a long run affordable and on task, and what each did on a 99-report batch.Intermediate
- Parallel tool calls Which tool calls can safely overlap, a runner that keeps the model’s order, and what it saves.Intermediate
- Sub-agents Run your agent loop again inside a tool to answer one question, and when that doesn’t pay off.Intermediate
- MCP in Go The Model Context Protocol on the wire, a Go client for it, and how far to trust another program’s tools.Intermediate
- RAG in Go Split 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 sessions Notes an agent saves, replaces, and recalls by meaning, measured against no memory and the whole history.Intermediate
Production
- Why the agent stopped Naming every way a run can end: typed errors, budgets, reply checks, and cancellation.Intermediate
- Retries and observability What to retry, how to back off, and traces that show where a run’s time and money went.Advanced
- Testing an agent offline Testing an agent without a live model: scripted models, replayed HTTP, and outcome checks.Intermediate
- Evals for an agent How to tell whether an agent is good, and whether a change made it better.Advanced
- Prompt injection and sandboxing A threat model, a ladder of sandboxes, and five layers of defense against prompt injection.Advanced
- Human approval Putting a person in front of risky tool calls, with a gate the model can’t route around.Advanced
- Agent identity Whose rights an agent uses, how to hand them over safely, and how to prove afterward who did what.Intermediate
- Durable runs Surviving a crash without losing work or doing it twice: checkpoints, locks, and idempotency keys.Advanced
- An agent as a service Running an agent unattended: restarts, shutdown, secrets, a work queue, budgets, and reviews.Advanced
- Launch checklist Twenty-three checks for an agent that runs unattended and spends money.Advanced
Go ecosystem
- Why Go Where Go’s standard tools did an agent’s work in the book’s code, with numbers, and what Go costs.Beginner
- Providers and SDKs One agent loop on providers whose APIs disagree, with each SDK behind your own interface.Intermediate
- How two provider APIs differ The same request on OpenAI-style and Anthropic APIs differs in twelve places. Here is each one.Intermediate
- More providers How Gemini, Ollama, Bedrock, and Cohere carry tools and stop reasons, for writing an adapter.Intermediate
- Libraries and SDKs Every SDK and framework the book’s code uses, with its version, its strengths, and its costs.Intermediate
- Go agent frameworks compared Five Go agent frameworks set against the parts of a harness, with one task ported and measured.Advanced
Examples
- ch01: A scripted agent loop A complete agent loop that fixes a failing test from a script. No key, no network.Beginner
- ch04: A real agent fixes a failing test The same loop on a real model’s recorded replies, with go test running for real.Beginner
- ch07: Four crash reports, triaged The crash-triage agent’s first run on four crash reports, replayed and graded offline.Intermediate
- Example Streaming to a browser An agent’s progress streamed to a web page with net/http and server-sent events.Intermediate
- ch10: Filing issues over MCP The agent filing issues through an MCP server, with the server’s tool definitions pinned.Intermediate
- ch16: One task, three implementations One approval-gated task on the book’s code, Eino, and Genkit, with every request recorded.Advanced
Research
- The finished agent The book’s final agent on 20 held-out tasks and three models: pass rates, costs, and failures.Intermediate
- Measured mistakes Twelve failures from recorded runs, each with how often it happened and what the code changed.Intermediate
- One sentence decided 79 of 80 first moves One sentence in an MCP tool’s description steered four models’ first move in 79 of 80 replies.Advanced
- How a tool error’s wording changed the turns Two wordings of the same tool error: one kept three models retrying, the other stopped them all.Intermediate
- Workflow or agent, measured One Go bug fixed by a three-step workflow and by an agent, on four models: cost, speed, failures.Intermediate
- Fan-out, measured One agent per cause, four at a time, against one agent for 99 reports: no faster, and it cost more.Intermediate
- Two identical runs, 15 points apart The same agent, run twice, scored 15 points apart. How to tell a real improvement from chance.Advanced
- 910 crashes, no duplicates The agent crashed at every point and restarted: what caused duplicates, and what removed them.Advanced