Skip to content
AI Agents in Go
  • Start here
  • Basics
  • Build
  • Production
  • Ecosystem
  • Examples
  • Research
  • Glossary
  • The book
  • Work with me
In a workshop under a lamp, the Gopher on a stool holds up a wrench, while the Ghost, a stone android, sits on the floor with a wrench from the pegboard, a finger to its head, studying a blank crash report pinned among the tools.

Section

Build

The choices you make once the loop runs: a workflow or an agent, tools a model uses well, streaming, answers in a fixed shape, long contexts, parallel work, sub-agents, and MCP.

  1. Build your first agent A complete agent in a few short files of standard-library Go, run offline and then on your own files.
  2. Workflow or agent? Five shapes of program that call a model, and how to pick the simplest one that handles the task.
  3. Designing tools What the model sees of a tool, and how to write names, schemas, results, and errors it uses well.
  4. Streaming replies Reading server-sent events with bufio and an iterator, and rebuilding tool calls from fragments.
  5. Structured output Get a typed, checked answer from any tool-calling model by making the answer a final tool.
  6. Context management Five ways to keep a long run affordable and on task, and what each did on a 99-report batch.
  7. Parallel tool calls Which tool calls can safely overlap, a runner that keeps the model’s order, and what it saves.
  8. Sub-agents Run your agent loop again inside a tool to answer one question, and when that doesn’t pay off.
  9. MCP in Go The Model Context Protocol on the wire, a Go client for it, and how far to trust another program’s tools.

Each design page names the problem, shows the design in Go, and says what it cost when the book measured it, with a short list of when to reach for it and when to leave it out.

AI Agents in Go

A code-first guide to building AI agents in Go, by Dayna Blackwell.

© 2026 Dayna Blackwell · RSS feed · What this covers

Not affiliated with or endorsed by Google or the Go project.

The Go gopher was designed by Renée French (CC BY 4.0).

Code excerpts come from the companion code, licensed under Apache 2.0.

Bide, Dayna Blackwell's library for durable agents

Fonts under the SIL Open Font License: Cinzel, Inter, and Space Grotesk.