golato

module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2026 License: MIT

README

Golato logo
made by my sister

[!WARNING] Golato is still being churned. The recipe is in progress, and nothing is promised yet.

Golato

Golato is a Go library for building applications with AI models. It sends model requests, streams responses, runs tools across turns, summarizes older conversation messages, and turns text into vectors.

Golato requires Go 1.26.6 or newer.

It gives an application a direct Generator for one request and an Agent for a tool loop. The application keeps conversation state and decides storage, access, tool permissions, retrieval, ranking, and product behavior. Golato does not retain conversation state between calls.

Installing Golato

go get github.com/yongtenglei/golato@v0.3.0

Running a 150+ line coding agent powered by Golato

Try Golato through an interactive coding agent implemented in just over 150 lines of Go. It keeps conversation context, shows model thinking when available and tool activity, and uses the built-in read, bash, edit, and write tools.

Set the required model configuration:

export GOLATO_API_KEY="..."
export GOLATO_MODEL="..."

Set these when the service uses another OpenAI-compatible endpoint or the agent should start from another directory:

export GOLATO_BASE_URL="https://example.com/v1"
export GOLATO_WORKING_DIRECTORY="/path/to/project"

Run the versioned example directly:

go run github.com/yongtenglei/golato/examples/agent/coding-agent@v0.3.0

The built-in tools are not a sandbox. They can access host paths and run commands with the current process's permissions. Use credentials and files you are willing to expose, review every change, and read Using tools and the built-ins before running untrusted tasks.

Choosing a capability

  • Using a Generator sends one request and returns one assistant reply. Returned tool calls go back to the application, which can read events or wait for the result.
  • Running an Agent validates and runs registered tools across multiple model turns and returns an agent.Result. The host application stores result.Context to continue.
  • Compacting conversation context summarizes older messages and returns replacement conversation state for the host application.
  • Embedding a batch of text returns one vector for each input in input order.

Reading the manual

View the Golato Project Pages site. For v0.3.0, start at the manual index, then follow Getting started. The examples catalog contains the getting-started weather story, a tool loop with continuation, an interactive coding agent, and image-input programs.

Developing Golato

make check
make docs-dev

Open http://localhost:3300 to preview the documentation.

License

Except for the Golato logo, this repository is licensed under the MIT License. The Golato logo is © 2026 liuzi. All rights reserved.

Directories

Path Synopsis
adapters
openai
Package openai implements OpenAI-compatible generation and embedding adapters.
Package openai implements OpenAI-compatible generation and embedding adapters.
Package agent provides an immutable Agent definition and one stateful Run per execution.
Package agent provides an immutable Agent definition and one stateful Run per execution.
Package compaction replaces a tool-safe prefix of provider-visible context with a model-generated summary.
Package compaction replaces a tool-safe prefix of provider-visible context with a model-generated summary.
Package embedding defines the provider-neutral embedding boundary.
Package embedding defines the provider-neutral embedding boundary.
examples
agent/coding-agent command
Package main runs a host-scoped coding agent with Golato's built-in tools.
Package main runs a host-scoped coding agent with Golato's built-in tools.
agent/tool-loop command
Package main demonstrates a minimal OpenAI-compatible agent.
Package main demonstrates a minimal OpenAI-compatible agent.
getting-started/01-greeting command
Package main sends one greeting with a Generator.
Package main sends one greeting with a Generator.
getting-started/02-weather-tool command
Package main requests one weather tool call with a Generator.
Package main requests one weather tool call with a Generator.
getting-started/03-tool-loop command
Package main runs a weather tool loop in the host application.
Package main runs a weather tool loop in the host application.
getting-started/04-agent command
Package main runs the weather tool loop with an Agent.
Package main runs the weather tool loop with an Agent.
image-input/data command
Package main sends the Golato logo as inline image data.
Package main sends the Golato logo as inline image data.
image-input/url command
Package main sends the Golato logo as a remote image URL.
Package main sends the Golato logo as a remote image URL.
Package generation defines the provider-neutral streamed generation boundary.
Package generation defines the provider-neutral streamed generation boundary.
Package message defines the provider-neutral transcript used by golato.
Package message defines the provider-neutral transcript used by golato.
Package provider defines errors reported while a model capability interacts with an upstream provider.
Package provider defines errors reported while a model capability interacts with an upstream provider.
Package skills defines independent instruction resources and prompt composition helpers.
Package skills defines independent instruction resources and prompt composition helpers.
Package token defines the small token-estimation boundary used for context budgeting.
Package token defines the small token-estimation boundary used for context budgeting.
Package tool defines callable tools exposed to an agent.
Package tool defines callable tools exposed to an agent.
builtin
Package builtin provides host-permission filesystem and Bash tools for agent.Config.Tools.
Package builtin provides host-permission filesystem and Bash tools for agent.Config.Tools.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL