G
YouTube TikTok Games
Skip to content
mdalgitsisPublic

About

Learning LLM agent development in Go, one concept at a time: five self-contained stages from a single agent to agent-to-agent communication with a registry, memory and MCP tools

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

agent-lab

build Go License

Learning LLM agent development in Go, one concept at a time.

Five self-contained stages. Each one adds exactly one idea to the last, and each builds and runs on its own — so you can read the diff between two stages and see precisely what that concept costs.

I wrote these while moving from "I have read about agents" to "I can build one," coming from a networking and Kubernetes background rather than an ML one. They are kept as they were written, including the parts that are more elaborate than they needed to be.

The five stages

Stage Adds Lines
01 getting-started A single LLM-powered agent. No tools, no MCP, no inter-agent communication — just the loop ~1,700
02 mcp-example MCP tools. The same agent, now connecting to a remote MCP server and calling what it finds there ~2,050
03 agent-chain A pipeline. Four specialised agents behind a gateway — intent, architect, validator, executor — each a separate service, wired with compose ~1,650
04 multi-agent The gateway pattern, consolidated into one Go service rather than four ~2,000
05 a2a Agent-to-agent. A generic agent driven by YAML, a registry, memory, telemetry, an LLM adapter, MCP servers, and Kubernetes manifests ~9,500

Read them in order. The interesting parts are the transitions:

  • 01 → 02 is where the agent stops being a text generator and starts doing things.
  • 02 → 03 is where one agent becomes several, and you meet the real problem: deciding which agent should handle what, and what happens when one of them is wrong.
  • 03 → 04 is the walk-back — the four-service pipeline collapsed into one process, because the distribution was not paying for itself at that size.
  • 04 → 05 is the jump: agents that discover each other through a registry, describe their own capabilities, and are configured rather than coded. 05-a2a/cmd/generic-agent is a single binary that becomes a different agent depending on the YAML you hand it.

Running a stage

Each directory is an independent Go module:

cd 01-getting-started
go build ./...
go test ./...

Stage 05 has the most to look at — start with 05-a2a/README.md and 05-a2a/docs/GENERIC-AGENT.md.

You will need an LLM API key. Every stage reads it from the environment; nothing is committed, and container registry references are placeholders.

What this is not

  • Not a framework. No shared library, no abstraction spanning the stages. Each is standalone on purpose — that is what makes the diffs readable.
  • Not production code. It is a lab. The agents demonstrate ideas; the demo agents fetch weather, estimate travel budgets and tell the time.
  • Not a tutorial series. There is no narrative hand-holding, just working code at five levels of ambition, with a README in each.

Built on Google ADK and the Model Context Protocol.

License

Apache License 2.0.

About

Learning LLM agent development in Go, one concept at a time: five self-contained stages from a single agent to agent-to-agent communication with a registry, memory and MCP tools

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages