
Erlang/OTP: The Old Patterns Agentic AI Is Rediscovering
A DEV Community post argues that today’s agent frameworks are rebuilding, piece by piece, what Erlang/OTP has offered as a native runtime feature since 1986: isolated state, message passing and supervision trees.
Software engineer Matheus de Camargo Marques published a post on DEV Community arguing that the agent frameworks the AI industry announces every few months keep re-implementing what Erlang/OTP and the BEAM virtual machine have had built into the runtime since 1986: isolated state, message passing, supervision hierarchies and automatic fault recovery.
His argument is not that one language wins: the shape of the problem forces the same answer. An agent with its own memory and message queue mirrors the actor model Carl Hewitt proposed in 1973 and Erlang shipped as a runtime in 1986, not by coincidence but because concurrent, stateful work demands it.
A microservices map that already exists in OTP
The post starts from a Teksystems article from April 2026 that maps microservices concepts onto agentic equivalents: service discovery becomes agent capabilities reached over MCP, an API gateway becomes a root agent or supervisor routing requests to sub-agents, and stateless logic becomes session management.
Marques gives each row an OTP counterpart: Registry and :global for discovery, Supervisor and DynamicSupervisor for routing and agent pools, GenServer state with :ets tables for data, and pattern matching for contracts. He also quotes a December 2025 VentureBeat piece that calls an assistant built from one sprawling prompt a “cognitive monolith”.
Working code: GenServer, gen_statem, ETS
The second half of the article is a set of compact Elixir examples. A GenServer agent holds conversation history and trims it to avoid context dilution; a supervision tree with a Registry discovers agents and restarts them after a crash; a DynamicSupervisor spawns agents on demand, which he maps to VentureBeat’s “conversational swarms”.
For ReAct loops he prefers gen_statem over GenServer, because the reasoning cycle then becomes an explicit state machine with idle, reasoning, acting and done states. A tool registry of roughly 50 lines of ETS-backed Elixir reproduces the MCP discovery pattern without a Python runtime, and a GenServer harness wraps provider API calls.
What OTP gives you for free
The most concrete gain is recovery: if a GenServer crashes, its supervisor restarts it while sibling processes keep running, a claim the documentation of the Elixir agent framework Jido also makes. State can be rebuilt by checkpointing to ETS or a database, by event sourcing, or by snapshot plus replay.
Each process also carries its own heap, so sandboxing needs process isolation, timeouts and heap limits rather than containers. OTP’s observability tools expose the process tree, GenServer state and message flows. Quoting Matheus Guimaraes at AWS Summit London, Marques closes: “Patterns never die. They just get new disguises.”
SiTech — AI-powered web development
We build fast, modern websites and bring AI into real business workflows. Have a project or a question? We'd love to help.