Prerequisites
Use Go 1.25.3 or later, matching the SDK’sgo.mod, and an API key for the provider you want to call. This example uses OpenAI directly and requires no gateway, Redis, or workflow service.
Install
Create an application module, then add the SDK:go.mod and go.sum to pin the resolved dependencies. Use go get github.com/hastekit/agent-sdk-go@<version> when upgrading to a specific release.
Set OPENAI_API_KEY in your environment. Do not put the key in source control.
Create an agent
Save this asmain.go:
go run ..
NewLLMClient holds provider configuration. Model("OpenAI/gpt-4.1-mini") binds the provider and model for subsequent requests. NewAgent validates the agent configuration and returns an error on invalid setup. Run waits for completion; Text() extracts assistant text from the result.
The agent uses in-memory history and a process-local stream broker by default. Those defaults are useful for a first run, but do not provide persistence across restarts or communication between replicas.