internal/website/docs/architecture.md
Go Micro is one runtime for the services → agents → workflows lifecycle. The same registry, client/server RPC, store, broker, and gateway primitives that run a service also give an agent discoverable tools, durable state, interop, and a place to hand off deterministic work.
Services → Agents → Workflows
handlers model loop durable orchestration
registry memory triggers and ordered steps
RPC tools guardrails agent dispatch
The layers are progressive: start with a service, expose its endpoints as tools, wrap those tools with an agent, then move the known paths into flows so the model only handles the uncertain parts.
Go Micro's service framework supplies the distributed-systems base every agent needs:
That substrate is intentionally not separate from the agent stack. A service endpoint is the smallest useful unit of work, and the registry is the source of truth for which tools and agents exist.
Agents compose the service substrate with the AI-specific packages:
model / ai.Model — a pluggable model interface normalizes provider calls
while letting applications pick Anthropic, OpenAI, Gemini, Atlas Cloud, Groq,
Mistral, Together AI, or a mock model for no-secret tests.store / memory — agent history, plans, run state, and compacted memory live
in durable storage rather than in an in-process chat loop.ai.Tools — discovers registered service endpoints and executes them through
the Go Micro client, so tools are generated from running services instead of a
parallel tool registry.agent — runs the tool-calling loop with guardrails, planning, delegation,
service-backed memory, and an Agent.Chat RPC endpoint. An agent is therefore a
service other clients and agents can call.The result is a harness, not just a prompt loop: model calls are bounded by tool scope, state is recoverable, and the same CLI and gateways that reach services can reach agents.
Use flow when the path is known or must be repeatable. Flows subscribe to broker
events, run ordered deterministic steps, and can dispatch to an agent at the point
where judgment or language understanding is needed. This keeps long-running work
observable and restartable while preserving agents for open-ended decisions.
A common shape is:
ticket.created.Gateways project the same runtime to external callers:
micro api exposes service RPC over HTTP.micro mcp exposes registered service endpoints as Model Context Protocol
tools for external agents.micro a2a exposes registered Go Micro agents through the Agent2Agent
protocol and lets Go Micro flows or agents dispatch to agents hosted elsewhere.MCP is the services-as-tools boundary; A2A is the agents-as-agents boundary. Both come from registry metadata, so adding a service or agent updates the external surface without duplicate wiring.
If you are new, follow the architecture in the same order the runtime composes it:
PATH, version, and no-secret smoke path are healthy.micro agent demo — print the
provider-free first-agent command and next docs steps from the installed CLI.