A framework for building services and agents in Go.
Go Micro started with service communication: RPC, discovery, and pub/sub built on pluggable interfaces. That foundation now gives agents tools they can discover and call. You can build services independently, add an agent to work with them, and use workflows for repeatable sequences of work.
Registry, client/server, broker, transport, codec, and store remain independently usable. See the architecture for how the pieces fit together.
With Go 1.25 or newer:
mkdir assistant && cd assistant
go mod init example.com/assistant
go get go-micro.dev/v6
export OPENAI_API_KEY=your-api-key
Save as main.go, then run go run .:
package main
import (
"log"
"os"
"go-micro.dev/v6"
)
func main() {
assistant := micro.NewAgent("assistant",
micro.AgentPrompt("Use your tools to carry out requests."),
micro.AgentProvider("openai"),
micro.AgentAPIKey(os.Getenv("OPENAI_API_KEY")),
micro.AgentServices(), // Start without application service tools.
)
if err := assistant.Run(); err != nil {
log.Fatal(err)
}
}
Give it capabilities by writing services and selecting their registered names with micro.AgentServices("notes", "search"). These are services you supply; their endpoints become the agent's tools. An agent can return an answer, perform an action, or call a service that builds and saves something for later use.
Follow Your First Agent for a complete service-backed agent. Agents can be called through Go, RPC, or the CLI.
Install the optional CLI and talk to the agent from another terminal:
go install go-micro.dev/v6/cmd/micro@latest
micro chat
Chat connects directly when one agent is registered; no agent name or local provider key is needed. With multiple agents, a local model routes requests.
To develop through conversation, run micro chat in a new directory with your provider key exported. With no registered agents, the CLI's development agent can generate, build, and start services, then use them as tools. Those processes stop when chat exits; the source remains. Use micro run to continue developing the project. When agents are registered, chat routes to them.
See the Quick Start and CLI reference for generation, hot reload, and deployment.
Browse the examples, run the provider-free first-agent example, or follow the 0→hero reference.