# alloy v0.12.4 - Table of Contents

> Model-agnostic agent harness for Elixir

## Pages

- Guides
  - [Event envelope specification (v1)](events.md)
  - [Alloy Quickstart](quickstart.md)

- Recipes
  - [Recipe: Sub-agents as tools](sub-agents.md)
  - [Recipe: MCP servers as tools](mcp-tools.md)

## Modules

- [Alloy.Agent.Events](Alloy.Agent.Events.md): Deprecated alias for `Alloy.Events`.
- [Alloy.Provider.OpenAIStream](Alloy.Provider.OpenAIStream.md): Shared OpenAI-format SSE stream parser.
- [Alloy.Provider.SSE](Alloy.Provider.SSE.md): Shared SSE (Server-Sent Events) framing utilities.

- Core
  - [Alloy](Alloy.md): Model-agnostic agent harness for Elixir.
  - [Alloy.Agent.Config](Alloy.Agent.Config.md): Configuration for an agent run.
  - [Alloy.Agent.Server](Alloy.Agent.Server.md): OTP-backed persistent agent process.
  - [Alloy.Agent.State](Alloy.Agent.State.md): Mutable state for an agent run.
  - [Alloy.Agent.Turn](Alloy.Agent.Turn.md): The core agent loop.
  - [Alloy.Events](Alloy.Events.md): Event envelope construction and runtime opts normalization.
  - [Alloy.Message](Alloy.Message.md): Normalized message struct used throughout Alloy.
  - [Alloy.ModelCatalog](Alloy.ModelCatalog.md): Behaviour for pluggable model-metadata catalogs.
  - [Alloy.ModelMetadata](Alloy.ModelMetadata.md): Built-in model metadata catalog used for context budgeting.
  - [Alloy.Result](Alloy.Result.md): Structured result from an agent run.
  - [Alloy.Session](Alloy.Session.md): Serializable session container.
  - [Alloy.Usage](Alloy.Usage.md): Token usage tracking across turns.

- Providers
  - [Alloy.Provider](Alloy.Provider.md): Behaviour for LLM providers.
  - [Alloy.Provider.Anthropic](Alloy.Provider.Anthropic.md): Provider for Anthropic's Claude Messages API.
  - [Alloy.Provider.Codex](Alloy.Provider.Codex.md): Provider for ChatGPT-plan-backed Codex execution via `codex exec`.
  - [Alloy.Provider.Gemini](Alloy.Provider.Gemini.md): Provider for Google's Gemini GenerateContent API.
  - [Alloy.Provider.OpenAI](Alloy.Provider.OpenAI.md): Provider for OpenAI's Responses API.
  - [Alloy.Provider.OpenAICompat](Alloy.Provider.OpenAICompat.md): Generic OpenAI-compatible provider.
  - [Alloy.Provider.Retry](Alloy.Provider.Retry.md): Provider retry, backoff, fallback, and streaming dispatch logic.
  - [Alloy.Provider.Test](Alloy.Provider.Test.md): A scripted test provider that returns pre-configured responses in order.
  - [Alloy.Provider.XAI](Alloy.Provider.XAI.md): Provider for xAI's Grok models.

- Tools
  - [Alloy.Tool](Alloy.Tool.md): Behaviour for tools that agents can call.
  - [Alloy.Tool.Core.Bash](Alloy.Tool.Core.Bash.md): Built-in tool: execute shell commands via `bash -rc` (restricted shell).
  - [Alloy.Tool.Core.Edit](Alloy.Tool.Core.Edit.md): Built-in tool: search-and-replace edits on files.
  - [Alloy.Tool.Core.Read](Alloy.Tool.Core.Read.md): Built-in tool: read files with line numbers.
  - [Alloy.Tool.Core.Write](Alloy.Tool.Core.Write.md): Built-in tool: write files, creating parent directories as needed.
  - [Alloy.Tool.Executor](Alloy.Tool.Executor.md): Executes tool calls and returns result messages.
  - [Alloy.Tool.Inline](Alloy.Tool.Inline.md): A tool defined as data instead of a module.
  - [Alloy.Tool.Registry](Alloy.Tool.Registry.md): Builds tool schemas and function maps from tool definitions.

- Context
  - [Alloy.Context.Compactor](Alloy.Context.Compactor.md): Summary-based context compaction.

- Memory
  - [Alloy.Memory](Alloy.Memory.md): Behaviour for a memory store compatible with Anthropic's `memory_20250818`
tool.
  - [Alloy.Memory.Router](Alloy.Memory.Router.md): Routes `memory_20250818` tool calls to a configured `Alloy.Memory`
store.

- Middleware
  - [Alloy.Middleware](Alloy.Middleware.md): Behaviour for middleware that wraps the agent loop.

- Testing
  - [Alloy.Testing](Alloy.Testing.md): ExUnit helpers for testing agents built with Alloy.

