Framework
BeamAI · The AI agent framework for Erlang/OTP
BeamAI is the framework's core library, providing three foundations for building agents: ChatClient, a unified LLM client, and SimpleAgent. The design borrows from Semantic Kernel: ChatClient itself is stateless and records no messages — conversation history is managed by a Memory Filter keyed by conversation_id.
Erlang/OTP's lightweight processes and supervision trees make agents a fit for long-running, high-concurrency server workloads. Tool libraries, RAG, MCP, A2A, AG-UI and more live in BeamAI Extra.
ChatClient · Filter · LLM client · SimpleAgent
LLM = beamai_chat_model:create(zhipu, #{
model => <<"glm-4.7">>,
api_key => list_to_binary(os:getenv("ZHIPU_API_KEY"))
}),
{ok, Response} = beamai_chat_model:chat(LLM, [
{role, user, content, <<"Hello!"/utf8>>}
]).Features
What it can do
One unified LLM client
OpenAI, Anthropic, DeepSeek, Zhipu, DashScope, and Ollama behind a single sync and streaming interface; multimodal input, Anthropic caching / web search / citations, rate-limit headers, Retry-After-aware retries, and uniform error structures.
ChatClient and tools
Semantic tool registration and invocation: declare name, description, parameters, and handler in one map; ChatClient hands them to the model, runs the call, and fills results back in.
Onion-style filters
An interception chain around the model: insert logging, validation, rewriting, and safety checks before and after model and tool calls — independent and composable.
Conversation memory
History is decoupled from ChatClient: send only the latest message each turn while a Memory Filter manages history by conversation_id. Storage is pluggable (ETS, persistent DETS, or your own behaviour); sliding windows are provided by the agent side.
SimpleAgent
A ReAct-first agent: multi-turn dialogue, callback hooks, interruption and resume — a good fit for tool calls that need human confirmation.
Structured output
The output parser turns model output into JSON, XML, or CSV, retrying automatically when parsing fails.
Specifications
Technical specifications
| Runtime | Erlang/OTP 27+, built with rebar3 |
|---|---|
| Modules | beamai_core (ChatClient, Filter, Tool), beamai_llm (LLM client), beamai_agent (SimpleAgent) |
| Extensions | Tools, RAG, MCP, A2A, AG-UI — see BeamAI Extra |
| License | Apache License 2.0 |
FAQ
You might be wondering
BeamAI vs BeamAI Extra?
BeamAI is the core: ChatClient, the LLM client, and SimpleAgent. BeamAI Extra adds tool libraries, RAG, MCP, A2A, and AG-UI on top — pull in what you need.
Which model vendors?
OpenAI, Anthropic, DeepSeek, Zhipu, DashScope (Qwen), and Ollama built in, with identical sync and streaming interfaces. Other OpenAI-compatible services connect via base_url.
Where is conversation history stored?
Managed by the Memory Filter per conversation_id, with pluggable storage: ETS (memory), DETS (persistent), or your own behaviour.
What is the license?
Apache License 2.0, fine for commercial projects.
Open source
Apache 2.0 open source
The engine, tests, benchmarks, and design docs are all in the repository — read them, change them, file issues.
Related framework
BeamAI Extra · Tools, RAG, and protocol extensions for BeamAI
Extensions on the BeamAI core: file / shell / human-interaction tools and middleware, RAG, an MCP client and server, the A2A protocol, and an AG-UI event-stream server.