Learn by Example

Learn by building real microservices with go-micro

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


Hello Service

A minimal HTTP service using Go Micro, with a single endpoint.

NATS Transport

Pub/Sub with NATS Broker

Use the NATS broker for pub/sub.

Real-World Examples

Production-ready patterns and complete application examples.

RPC Client

Call a running service using the Go Micro client.

Service Discovery with Consul

Use Consul as the service registry.

State with Postgres Store

Use the Postgres store for persistent key/value state.