BeamAI Framework Dependencies
June 10, 2026 · View on GitHub
English | 中文
This document describes the dependencies of the BeamAI Framework, including external dependencies and dependencies between internal modules.
External Dependencies
Runtime Dependencies
| Package | Version | Purpose |
|---|---|---|
| jsx | 3.1.0 | JSON encoding/decoding |
| hackney | 1.20.1 | HTTP client (default backend) |
| gun | 2.1.0 | HTTP/1.1, HTTP/2, WebSocket client (optional backend) |
| uuid | 2.0.6 | UUID generation (package name: uuid_erl) |
| esqlite | 0.8.8 | SQLite database support (for persistent storage) |
HTTP Backend Configuration
BeamAI supports two HTTP client backends, configurable via settings:
%% Use Gun (default, supports HTTP/2)
application:set_env(beamai_core, http_backend, beamai_http_gun).
%% Use Hackney (stable and mature)
application:set_env(beamai_core, http_backend, beamai_http_hackney).
| Backend | Features | Use Cases |
|---|---|---|
| gun | HTTP/2 support, async, modern design | Default backend, high-concurrency scenarios |
| hackney | Sync API, built-in connection pool, stable | Legacy code compatibility |
Test Dependencies
| Package | Version | Purpose |
|---|---|---|
| meck | 0.9.2 | Mock library for unit testing |
Development Tools
| Plugin | Purpose |
|---|---|
| rebar3_proper | Property-based testing support |
| rebar3_ex_doc | Documentation generation |
Internal Application Dependencies
Dependency Hierarchy Diagram
+-----------------+
| beamai_examples |
+--------+--------+
| depends on all modules
+-------------------------+-------------------------+
| | |
v v v
+---------------+ +-----------------+ +---------------+
| beamai_mcp | |beamai_deepagent | | beamai_a2a |
|(Protocol Ext) | | (Advanced Agent)| | (A2A Protocol)|
+-------+-------+ +--------+--------+ +-------+-------+
| | |
| | v
| | +---------------+
| | | beamai_agent |
| | | (Agent) |
| | +-------+-------+
| | |
+------------------------+-----------------------+
|
+----------------------------+----------------------------+
| +----------+----------+ |
v v v v v
+-----------+ +-----------+ +-----------+ +-------------------+
|beamai_rag | |beamai_llm | | beamai_ | | beamai_tools |
| (RAG) | | (LLM) | | memory | | (Tools+Middleware)|
+-----+-----+ +-----+-----+ +-----+-----+ +---------+---------+
| | | |
| | implements | |
| | Behaviour | |
| +------+------+ |
| | |
| v |
| +------------------------+ |
| | Behaviour Interface | |
| | Definition | |
| | (beamai_chat_behaviour,| |
| | beamai_process_store_ | |
| | behaviour) | |
| +------------+-----------+ |
| | |
+----------------------+--------------------------+
v
+---------------------------+
| beamai_core | <- Base Layer
| (Types, Behaviour) |
+---------------------------+
|
v
+---------------------------+
| Erlang/OTP + External |
| Dependencies |
+---------------------------+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Runtime Optional Dependencies (injected via Adapter, not compile-time):
beamai_tools ···> beamai_llm (llm_client)
Dependency Direction Notes:
- Solid arrows (->) indicate compile-time dependencies (top to bottom)
- Dashed arrows (···>) indicate runtime optional dependencies (injected via Adapter)
beamai_deepagentdoes not depend onbeamai_agent, they are parallel implementationsbeamai_a2adepends onbeamai_agent(for Agent execution)beamai_mcpoptionally depends onbeamai_agentat the adapter layer (for tool conversion)beamai_tools,beamai_llm,beamai_memoryare at the same level, all only depend onbeamai_corebeamai_coredefines Behaviour interfaces (beamai_chat_behaviour,beamai_process_store_behaviour, etc.), upper-layer modules implement these interfacesbeamai_coredoes not depend onbeamai_memory, decoupled via{Module, Ref}dynamic dispatchbeamai_toolsuses beamai_llm/context at runtime via Adapter pattern, no compile-time dependency
Application Dependency Details
beamai_core (Core Library)
Dependencies: No internal dependencies
Provides:
- Type definitions (beamai_types)
- Common utility functions (beamai_utils)
- JSON-RPC support (beamai_jsonrpc)
- SSE support (beamai_sse)
- HTTP Client (pluggable backends)
beamai_http- Unified APIbeamai_http_hackney- Hackney backend (default)beamai_http_gun- Gun backend (HTTP/2 support)beamai_http_pool- Gun connection pool management
- Behaviour Definitions (for dependency decoupling)
beamai_chat_behaviour- LLM chat interface (formerly beamai_llm_behaviour)beamai_process_store_behaviour- Process store interface (with optional branch/time-travel callbacks)beamai_http_behaviour- HTTP client interface
beamai_memory (Pure Storage Engine)
Dependencies: beamai_core
Provides:
- Storage backends
- ETS storage (beamai_store_ets)
- SQLite storage (beamai_store_sqlite)
- Snapshot management (beamai_process_snapshot)
- Process store (beamai_process_memory_store) — implements beamai_process_store_behaviour
- State store (beamai_state_store)
beamai_tools (Tool System + Middleware System)
Dependencies:
- beamai_core (Behaviour definitions, type definitions)
Optional Dependencies (decoupled via Adapter pattern):
- beamai_llm (LLM client, for intelligent tool filtering/simulation Middleware)
- beamai_memory (Conversation buffer, for summarization Middleware)
Adapter Modules:
beamai_llm_adapter- Wraps LLM calls, defaults tollm_clientbeamai_buffer_adapter- Wraps conversation buffer, defaults tobeamai_conversation_buffer
Provides:
- Tool definition and registration (beamai_tool, beamai_tool_registry)
- Tool provider (beamai_tool_provider)
- Tool security (beamai_tool_security)
- Built-in tools
- File tools (beamai_tools_file)
- Shell tools (beamai_tools_shell)
- Todo tools (beamai_tools_todo)
- Human interaction tools (beamai_tools_human)
- Middleware system
- Middleware behaviour definition (beamai_middleware)
- Middleware runner (beamai_middleware_runner)
- Preset Middleware (beamai_middleware_presets)
- Built-in Middleware (middleware_call_limit, middleware_summarization, etc.)
beamai_llm (LLM Integration)
Dependencies:
- beamai_core
Provides:
- LLM client (llm_client)
- Multi-provider support
- OpenAI (beamai_llm_provider_openai)
- Anthropic (beamai_llm_provider_anthropic)
- DeepSeek (beamai_llm_provider_deepseek) - OpenAI compatible API
- Ollama (beamai_llm_provider_ollama)
- Zhipu AI (beamai_llm_provider_zhipu)
- Alibaba Cloud DashScope (beamai_llm_provider_dashscope) - DashScope native API
- Message adapter (beamai_llm_message_adapter)
- Tool adapter (beamai_llm_tool_adapter)
- Response parser (beamai_llm_response_parser)
beamai_rag (RAG System)
Dependencies:
- beamai_core
Provides:
- RAG pipeline (beamai_rag)
- Document splitting (beamai_rag_splitter)
- Vector store (beamai_vector_store)
- Embedding support (beamai_embeddings)
beamai_agent (Agent System)
Dependencies:
- beamai_core (headers: type definitions)
- beamai_llm (LLM calls)
- beamai_memory (checkpoints, memory management)
- beamai_tools (headers: tool definitions)
Note: beamai_agent is the core orchestration layer, does not depend on beamai_mcp. MCP tools are integrated into Agent through beamai_mcp's adapter layer, not reverse dependency.
Provides:
- Agent lifecycle management (beamai_agent)
- Agent initialization (beamai_agent_init)
- Agent runner (beamai_agent_runner)
- Callback system (beamai_callback_utils)
beamai_deepagent (Deep Agent System)
Dependencies:
- beamai_core
- beamai_llm
- beamai_memory
- beamai_tools (includes Middleware system)
Provides:
- Deep Agent core (beamai_deepagent)
- Planning system (beamai_deepagent_plan)
- Tool system
- Filesystem tools (beamai_deepagent_fs_*)
- Todo tools (beamai_deepagent_todo_*)
- Human interaction tools (beamai_deepagent_human_*)
- Execution tracing (beamai_deepagent_trace)
- CLI UI (beamai_deepagent_cli_ui)
beamai_a2a (Agent-to-Agent Protocol)
Dependencies:
- beamai_core
- beamai_agent
Provides:
- A2A server (beamai_a2a_server)
- A2A client (beamai_a2a_client)
- Agent Card management (beamai_a2a_card)
- Authentication (beamai_a2a_auth)
- Task management (beamai_a2a_task)
- HTTP handler (beamai_a2a_http_handler)
beamai_mcp (MCP Protocol)
Dependencies:
- beamai_core (JSON-RPC, SSE support)
- beamai_tools (headers: tool definitions)
- beamai_agent (optional, only used by adapter layer)
Provides:
- MCP server (beamai_mcp_server)
- MCP client (beamai_mcp_client)
- Transport layer
- HTTP transport
- beamai_mcp_transport_http (Hackney backend, default)
- beamai_mcp_transport_http_gun (Gun backend, HTTP/2 support)
- SSE transport
- beamai_mcp_transport_sse (Hackney backend, default)
- beamai_mcp_transport_sse_gun (Gun backend, HTTP/2 support)
- Stdio transport (beamai_mcp_transport_stdio)
- HTTP transport
- Tool proxy (beamai_mcp_tool_proxy)
- Agent adapter (beamai_mcp_adapter) - Converts MCP tools to Agent tools
Transport Layer Backend Configuration:
%% Use Gun backend (default, supports HTTP/2)
Config = #{
transport => http, %% or sse
url => <<"https://example.com/mcp">>
}.
%% Use Hackney backend
Config = #{
transport => http, %% or sse
backend => hackney,
url => <<"https://example.com/mcp">>
}.
Note: MCP core functionality can run independently, does not depend on beamai_agent. Only use the adapter layer when you need to integrate MCP tools into the Agent system.
beamai_examples (Examples)
Dependencies:
- beamai_core
- beamai_llm
- beamai_memory
- beamai_tools
- beamai_agent
- beamai_deepagent
- beamai_a2a
- beamai_mcp
Provides:
- Simple Agent example (example_agent_simple)
- Deep Agent example (example_agent_deep)
- Interactive Agent example (example_agent_interactive)
Erlang/OTP Dependencies
BeamAI Framework uses the following Erlang/OTP standard libraries:
| Module | Purpose |
|---|---|
| gen_server | Process management |
| gen_statem | State machine |
| supervisor | Supervision tree |
| ets | In-memory storage |
| persistent_term | Persistent term storage |
| logger | Logging |
| crypto | Cryptographic functions |
| ssl | SSL/TLS support |
| inets/httpc | HTTP client (backup) |
Installing Dependencies
# Fetch all dependencies
rebar3 get-deps
# Compile the project
rebar3 compile
# Run tests
rebar3 eunit
rebar3 ct
Version Compatibility
- Erlang/OTP: 25.0 or higher
- rebar3: 3.20.0 or higher
Optional Dependencies
The following dependencies are optional and can be enabled based on use cases:
| Dependency | Purpose | Enable Condition |
|---|---|---|
| cowboy | HTTP server | A2A/MCP server functionality |
| gun | HTTP/2 client | High-performance HTTP requirements |
| eredis | Redis client | Redis storage backend |
Updating Dependencies
Check compatibility before updating dependencies:
# Check outdated dependencies
rebar3 upgrade --all
# Update lock file
rebar3 lock