Golem Introduces a Type-Safe Go Framework for Production AI Agents
Summary
Golem is an open-source, Go-first framework for building production AI agents with compile-time type safety, typed dependencies and outputs, explicit tools, and no external dependencies. Its Agent[Deps, Output] API uses generics and RunContext[Deps] to pass dependencies without untyped maps or runtime reflection. The framework includes adapters for OpenAI, Anthropic, Google Gemini, AWS Bedrock, Azure OpenAI, Ollama, LM Studio, and other OpenAI-compatible services. It also provides a Model Context Protocol client over stdio and streaming HTTP, allowing external MCP servers to become agent tools. The execution loop supports model self-correction, retries, exponential backoff, fallback models, per-tool deadlines, cancellation, and partial evidence preservation. Runs can emit normalized messages, durable JSON, streaming events, token usage, costs, and reasoning-token data, while deferred execution allows human approval or external results before deterministic resumption. Built-in tools cover PDFs, office documents, web fetching, workspace files, shell commands, and progressively loaded Agent Skills. Budget controls estimate tokens, trim history, sanitize untrusted history, and cap costs using user-defined prices. Version 0.8.5 is described as having a frozen core contract, race-detector CI, memory fuzzing, and deterministic offline tests; the project targets additive API changes on the way to 1.0.0.