zgbjgg

zgbjgg

Hayata - An Erlang/OTP framework for building AI agents

Hayata is an Erlang/OTP framework for building AI agents using a graph-based execution model. It is designed to bring the benefits of Erlang’s concurrency, supervision, and fault-tolerance model to agent development, while remaining usable from both Erlang and Elixir applications.

The project started with a simple idea: what would an agent framework look like if it were designed around Erlang/OTP from the ground up?

Rather than treating agents as a collection of function calls, Hayata models execution through agents, nodes, and edges, with explicit process responsibilities and message passing.

What can you build with Hayata?

Hayata provides a runtime for coordinating agent execution and integrating LLMs into applications.

Some of its main features include:

  • Graph-based execution: Define nodes and control the execution flow through decision policies.

  • OTP supervision: Use supervised processes, monitoring, and message passing to manage execution and failures.

  • Parallel execution: Run multiple branches concurrently and collect their results in a predictable order.

  • LLM integration: Use provider adapters to connect agents to different LLM providers, including OpenAI, Anthropic, and Gemini.

  • Tool execution: Let an agent invoke tools, process their results, and continue the model interaction cycle.

  • Native streaming: Support streaming responses through the LLM integration layer.

  • Conversational memory: Keep conversational memory separate from the core execution runtime.

  • Telemetry: Observe agent invocations and execution lifecycles through Telemetry events.

The goal is not to reproduce another framework’s API feature by feature. Hayata follows its own design, built around Erlang/OTP primitives.

How does it work?

At a high level, an agent coordinates an invocation, nodes execute tasks, and a decision policy determines what happens next.

A policy can schedule another node, launch multiple nodes in parallel, or finish the invocation. Nodes and their associated processes manage execution and report their results back to the runtime.

For example, an agent using an LLM and a weather tool can follow this sequence:

  1. Send the user’s question to the LLM.

  2. Receive a tool call, such as get_weather.

  3. Execute the tool and collect its result.

  4. Send the tool result back to the LLM.

  5. Return the final answer, optionally as a streamed response.

The runtime coordinates this cycle, while provider adapters handle the communication and response normalization required by each LLM provider.

Why Erlang/OTP?

I think Erlang ecosystem’s strengths could be applied to AI agent execution.

Agents can involve concurrent tasks, external requests, long-running operations, and failures at different points in an execution. Erlang/OTP offers useful primitives for structuring these systems: supervised processes, monitoring, message passing, and explicit lifecycle management.

Hayata is an attempt to build on those primitives rather than hide them behind a generic agent abstraction.

Project status

Hayata is available on Hex, and the repository includes working examples and tests. The project is actively evolving as I develop the agent runtime and its LLM integrations.

Feedback, ideas, and contributions are welcome. I’d especially like to hear from people experimenting with AI agents in Erlang or Elixir, and from anyone interested in exploring OTP-based approaches to agent orchestration.

Links

Hex package: hayata | Hex

HexDocs: The hayata application

GitHub repository:

Where Next? Top

Trending in Announcing Top

achempion
Hi, I would like to tell about my initiative to further maintain and develop Waffle project which is the fork of Arc library. The progre...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
kip
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
gtcode
Aloha gang, There’s a new class of AI model out from TypeSafe. Jev is their flagship model. You can learn about it here: ...
New
danschultzer
I’ve moved the strategies out of PowAssent and created a multi-provider framework for Elixir. This way the strategies can be used in any ...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
raa-ziq
Hi everyone :waving_hand: I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
AstonJ
With advancements in AI gathering pace and set to increasingly accelerate, perhaps it’s worth having an annual thread on the topic - feel...
New
bartblast
If you haven’t tried Hologram yet, what’s stopped you? Here’s why I’m asking. Building a framework turns out to be two jobs, the framewo...
New
mat-hek
Popcorn, the library that runs Elixir code in the browser, is now stable :popcorn: This is possible because it now builds on a very stab...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews