Golato
Golato is a small, embeddable generation, embedding, and agent runtime library for Go. It sends one model request or runs a full agent loop, compacts long conversations, and embeds text, always returning shared types that carry between the operations.
Golato is still being churned. The recipe is in progress, and nothing is promised yet.
Choosing a capability
Choose the operation that owns the loop you need. The host application supplies requests and contexts and keeps the returned values.
| If you want to... | Start with | Finish with |
|---|---|---|
| send one model request | generation.Generator | stream.Result(ctx) |
| run tools over multiple model turns | agent.Agent | assistant.Run(ctx, input) or run.Wait() |
| replace old conversation messages | compaction.Compactor | compactor.Compact(ctx, request) |
| turn text inputs into vectors | embedding.Embedder | embedder.Embed(ctx, request) |
A Generator returns one response and hands tool calls back to the application. An Agent validates the calls, runs the
tools, appends the results, and requests the next turn itself. Both paths share message.Message and tool.Definition,
so an application can start with a Generator and move to an Agent without changing its conversation values.
Keeping application state in the application
Golato does not write a database, retain a transcript between calls, manage tenancy or access, retrieve memory, or apply
product policy. The host application stores agent.Result.Context when using an Agent.
Storing and continuing conversation state explains the handoff.
Reading the manual
Fundamentals
- Getting started: install an adapter and make a request
- Building messages and content: build prompts and inspect model content
- Defining tools: describe operations and return results
Generation
- Using a Generator: wait for one answer, stream it, and handle errors
- Observing generation events: consume and interpret the twelve event types
Agent
- Running an Agent: start runs, keep results, and continue work
- Observing Agent events: display a run without changing its result
- Using tools and the built-ins: validate calls, execute batches, and use built-ins
- Storing and continuing conversation state: persist and pass continuation state
- Compacting conversation context: summarize older messages and recover from provider overflow
Reaching a model
- Configuring the OpenAI-compatible adapter: configure an OpenAI-compatible HTTP endpoint
- Embedding a batch of text: send a batch and receive vectors
Reference
- Glossary: look up the shared terms of the manual
Running an example
The examples catalog lists commands that use the versioned module. The built-in tools run with the permissions of their host process. Read Using tools and the built-ins before giving them untrusted work.
read, bash, edit, and write can reach host files, processes, environment variables, and network resources. Use a
container, virtual machine, or other process isolation when the task is not trusted.
Reading the API reference
The package documentation describes every exported symbol. These links select v0.3.0 explicitly.