# Go AI Client Library > A multi-provider Go library for interacting with AI models through unified ## Docs - [Home](https://joakimcarlsson.github.io/ai/): A multi-provider Go library for interacting with AI models through unified - [Modules](https://joakimcarlsson.github.io/ai/modules/): The library is published as ~50 independent Go modules. - [Examples](https://joakimcarlsson.github.io/ai/examples/): The repository includes runnable examples under [`/examples`](https://github.com/joakimcarlsson/ai/tree/main/examples). ### Getting Started - [Installation](https://joakimcarlsson.github.io/ai/getting-started/installation/): - Go 1.25 or later - [Quick Start](https://joakimcarlsson.github.io/ai/getting-started/quick-start/): The `client` value satisfies the `llm.LLM` interface, so swapping vendors is ### Providers - [Overview](https://joakimcarlsson.github.io/ai/providers/overview/): Each modality has its own Go module. - [LLM](https://joakimcarlsson.github.io/ai/providers/llm/): Each native LLM vendor is published as its own Go module under `llm/`. - [Embeddings](https://joakimcarlsson.github.io/ai/providers/embeddings/): Each native embedding vendor is its own Go module under `embeddings/`. - [Image Generation](https://joakimcarlsson.github.io/ai/providers/image-generation/): The `image` modality. - [Audio](https://joakimcarlsson.github.io/ai/providers/audio/): The `tts` modality (formerly "audio generation"). - [Speech-to-Text](https://joakimcarlsson.github.io/ai/providers/speech-to-text/): The `stt` modality. - [Rerankers](https://joakimcarlsson.github.io/ai/providers/rerankers/): The `rerankers` modality. - [Decision Models](https://joakimcarlsson.github.io/ai/providers/decision/): The `decision` modality. - [Fill-in-the-Middle](https://joakimcarlsson.github.io/ai/providers/fim/): Code completion that takes a `Prompt` (code before the cursor) and an optional - [Vision](https://joakimcarlsson.github.io/ai/providers/vision/): Send images to LLMs for analysis using URL references or raw binary data. ### Agent Framework - [Overview](https://joakimcarlsson.github.io/ai/agent/overview/): The agent package provides multi-agent orchestration with automatic tool execution, session management, persistent memory, sub-agents, handoffs, fan-out, team coordination, and context strategies. - [Session Management](https://joakimcarlsson.github.io/ai/agent/sessions/): Sessions persist conversation history across multiple `Chat()` calls. - [Persistent Memory](https://joakimcarlsson.github.io/ai/agent/memory/): Memory enables cross-conversation fact storage and retrieval using vector-based semantic search. - [Streaming](https://joakimcarlsson.github.io/ai/agent/streaming/): `ChatStream` returns a channel of events for real-time response handling. - [Hooks](https://joakimcarlsson.github.io/ai/agent/hooks/): Hooks let you observe, modify, or block agent behavior at key points in the execution pipeline. - [Tool Confirmation](https://joakimcarlsson.github.io/ai/agent/confirmation/): The confirmation protocol lets tools require human approval before executing. - [Loop Continuation](https://joakimcarlsson.github.io/ai/agent/continuation/): The continuation protocol lets you control agent execution when it hits its tool iteration limit. - [Sub-Agents](https://joakimcarlsson.github.io/ai/agent/sub-agents/): Sub-agents let an orchestrator delegate tasks to specialized child agents. - [Background Agents](https://joakimcarlsson.github.io/ai/agent/background-agents/): Background agents let the orchestrator launch sub-agents asynchronously. - [Handoffs](https://joakimcarlsson.github.io/ai/agent/handoffs/): Handoffs transfer full control from one agent to another. - [Fan-Out](https://joakimcarlsson.github.io/ai/agent/fan-out/): Fan-out distributes multiple tasks to worker agents in parallel and collects results. - [Team Coordination](https://joakimcarlsson.github.io/ai/agent/team-coordination/): Team coordination enables peer-to-peer multi-agent collaboration where a lead agent dynamically spawns teammates that communicate via asynchronous messaging and coordinate work through a shared task board. - [Continue/Resume](https://joakimcarlsson.github.io/ai/agent/continue/): `Continue()` lets you manually execute tool calls and feed results back into the agent loop. - [Context Strategies](https://joakimcarlsson.github.io/ai/agent/context-strategies/): Context strategies automatically manage the context window when conversations grow beyond token limits. - [Toolsets](https://joakimcarlsson.github.io/ai/agent/toolsets/): Toolsets group multiple tools under a name with optional dynamic filtering. - [Instruction Templates](https://joakimcarlsson.github.io/ai/agent/instruction-templates/): Dynamic system prompts using template variables or runtime-generated instructions. ### Integrations - [PostgreSQL](https://joakimcarlsson.github.io/ai/integrations/postgres/): PostgreSQL-backed session store for persistent conversation history. - [SQLite](https://joakimcarlsson.github.io/ai/integrations/sqlite/): SQLite-backed session store for lightweight persistent conversation history. - [pgvector](https://joakimcarlsson.github.io/ai/integrations/pgvector/): PostgreSQL-backed memory store using [pgvector](https://github.com/pgvector/pgvector) ### Advanced - [Batch Processing](https://joakimcarlsson.github.io/ai/advanced/batch-processing/): Process bulk LLM and embedding requests efficiently using provider-native - [BYOM](https://joakimcarlsson.github.io/ai/advanced/byom/): Use Ollama, LocalAI, vLLM, LM Studio, or any OpenAI-compatible inference - [MCP Integration](https://joakimcarlsson.github.io/ai/advanced/mcp/): This library integrates with the official [Model Context Protocol Go SDK](https://github.com/modelcontextprotocol/go-sdk) to provide seamless access to MCP servers and their tools. - [Tool Calling](https://joakimcarlsson.github.io/ai/advanced/tools/): For simple tools that are just a function, use `functiontool.New` to skip the struct boilerplate: - [Structured Output](https://joakimcarlsson.github.io/ai/advanced/structured-output/): Constrained generation that forces the LLM to return valid JSON matching a schema. - [Reasoning](https://joakimcarlsson.github.io/ai/advanced/reasoning/): Models that support chain-of-thought reasoning can be configured to control - [Cost Tracking](https://joakimcarlsson.github.io/ai/advanced/cost-tracking/): All models include built-in pricing information for cost calculation. - [Prompt Templates](https://joakimcarlsson.github.io/ai/advanced/prompt-templates/): A template engine for building dynamic prompts with variable substitution, built-in functions, caching, and validation. - [OpenTelemetry Tracing](https://joakimcarlsson.github.io/ai/advanced/tracing/): Built-in OpenTelemetry instrumentation for all provider calls and agent execution. - [Configuration](https://joakimcarlsson.github.io/ai/advanced/configuration/): After the modular split, every option lives on the vendor module.