Examples

Learn by building real microservices with go-micro

Learn by Example

Runnable examples are the fastest way to move from reading the guides to changing one thing. Start with the path that matches where you are in the services → agents → workflows lifecycle.

Start here

For the provider-free first-agent route, run examples/first-agent, then follow No-secret First Agent, Your First Agent, Debugging your agent, and the 0→hero Reference.

GoalRunnable exampleWhy it is useful
0→1 serviceexamples/hello-worldSmallest RPC service with a client call and health checks.
Provider-free first agentexamples/first-agentSmallest service-backed agent with a deterministic mock model; no provider key required.
First service-backed agentexamples/agent-demoMulti-service project/task/team app with agent playground integration.
0→hero lifecycleexamples/supportNo-secret support-desk story: typed services, an agent, an event-driven flow, and a guardrail.
Planning and delegationexamples/agent-plan-delegateTwo agents collaborate through plan and delegate over normal Go Micro RPC.
Durable agent runsexamples/agent-durableCheckpoint and resume a model-directed run without replaying completed tool side effects.
Durable workflowsexamples/flow-durableOrdered, checkpointed flow steps resume without duplicating completed side effects.
AI-callable servicesexamples/mcpMCP examples that expose service endpoints as model tools.

Guide-to-example map

Repository examples

See the repository examples index for the complete runnable list, including deployment, auth, gRPC interop, MCP, agent, and flow examples.

More


Learn by Example

A collection of small, focused examples demonstrating common patterns with Go Micro.

Real-World Examples

Production-ready patterns and complete application examples.

Hello Service

NATS Transport

Pub/Sub with NATS Broker

RPC Client

Service Discovery with Consul

State with Postgres Store