Erlang/OTP and Elixir libraries for AI coding agent wire protocols. OTP-native, fault-tolerant, and production-ready.
Every SDK is a proper OTP application. Supervision trees, telemetry, and fault isolation come standard — not bolted on.
Each agent session is a supervised gen_statem. Crashes are isolated and recoverable.
State changes, queries, buffer overflows — optionally instrumented via :telemetry (zero overhead when absent).
Permission handlers default to deny. Explicit opt-in for tool execution and file access.
Define custom tools as Erlang functions. In-process MCP server registry with SDK integration.
Threads, checkpoints, session store, and control protocol — available on every adapter.
Bidirectional conversion between messages and typed content blocks across all protocols.
Structured error categories (rate_limit, subscription_exhausted, context_exceeded, auth_expired, server_error, unknown) on every error message — pattern match, don’t parse.
All five backends share a three-layer design. The public API delegates to a shared session engine, which dispatches to per-backend protocol handlers.
A single canonical SDK with five protocol-specific adapters, documented for both Erlang and Elixir.
Shared types, JSONL parsing, JSON-RPC, hooks, MCP servers, telemetry, session store, threads, checkpoints, command execution, global registries (agents, plugins, slash commands, SDK config), reload bus, and the transport behaviour.
Anthropic Claude Code agent SDK. Stdio transport, elicitation, session disk store, and native interrupt support.
OpenAI Codex CLI agent SDK. Dual-mode sessions (interactive + exec), port-based transport, and turn management.
GitHub Copilot agent SDK. LSP-style framing, user input requests, and content-length delimited transport.
Google Gemini CLI agent SDK. JSON-RPC over NDJSON with persistent ACP sessions.
OpenCode agent SDK. HTTP/SSE transport with REST session management and server-sent event streaming.
All capabilities are fully supported across every backend. The matrix shows how each is implemented: native backend call, universal OTP shim, or both.
| Capability | Claude | Codex | Gemini | OpenCode | Copilot |
|---|---|---|---|---|---|
| Session lifecycle | |||||
| Session info | |||||
| Model switch | |||||
| Interrupt | |||||
| Permission mode | |||||
| Session history | |||||
| Session mutation | |||||
| Thread management | |||||
| Metadata accessors | |||||
| MCP servers | |||||
| MCP management | |||||
| Hooks | |||||
| Checkpointing | |||||
| Thinking budget | |||||
| Task stop | |||||
| Commands | |||||
| Approval callbacks | |||||
| User input callbacks | |||||
| Realtime review | |||||
| Config management | |||||
| Provider management | |||||
| Attachments | |||||
| Event streaming |
Add a dependency and start a session in a few lines.
BeamAgent encrypts credentials at rest using a key derived from the BEAM node cookie. You don't need distributed Erlang — just a cookie set on the local node.
Without a cookie, erlang:get_cookie() returns nocookie — a publicly
known atom. BeamAgent auto-generates a secure ephemeral cookie and logs persistence instructions.
Pre-configure a cookie for production to avoid ephemeral keys.
| Runtime | Minimum Version | Tested Up To |
|---|---|---|
| Erlang/OTP | 27 | 28 |
| Elixir | 1.17 | 1.19 |
| Rebar3 | 3.x | latest |