bradley

bradley

beamlens - Adaptive Runtime Intelligence for the BEAM

Hi everyone

I’m really excited to announce Beamlens, a library that brings adaptive runtime intelligence to the BEAM.

The Pitch

Claude Code, Tidewave and other tools have been widely successful and useful for many people. Beamlens takes the same exact philosophy as those tools but puts the AI directly in your supervision tree in the form of multiple GenSevers orchestrating agentic loops.

It allows your application to self-diagnose incidents, analyze traffic patterns, and (optionally) optimize its own performance.

Watch the Demo: DEMO VIDEO

Why I built this

I created Beamlens for two main reasons:

  1. Context is lost after the crash: I’ve spent a ton of time debugging production applications. Monitoring tools show you the metrics after the fact, but they rarely capture the full runtime state (ETS tables, process dictionaries, etc.) at the exact moment of the incident.
  2. The BEAM is built for this: The BEAM is uniquely positioned to make Elixir the best language for the AI era. I believe we can have applications that are both fault-tolerant and self-evolving.

How it works

You add Beamlens to your supervision tree. It stays dormant until triggered (by telemetry, an alarm handler, or manually).

Out of the box Beamlens provides skills for tracking BEAM health, ETS tables, garbage collection, logging and more. In addition you can add your own skills by implementing a very simple behaviour module and then declaring the skill in your supervision tree.

# 1. Trigger an investigation when something goes wrong
{:ok, result} = Beamlens.Coordinator.run(%{reason: "memory usage > 90%"})

# 2. Beamlens introspects the runtime and returns semantic insights
# Result: "Worker pool exhausted; processes are not hibernating after large binary handling."

Skills & Extensibility

Out of the box, Beamlens provides skills for tracking BEAM health, ETS tables, garbage collection, and logging.

You can also teach it to understand your specific domain by implementing a simple behaviour.

For example, here is a “Healer” skill that gives the agent permission to remediate issues:

defmodule MyApp.Skills.Healer do
  @behaviour Beamlens.Skill

  # Explicitly allow the operator to kill a process
  # Note: The agent can only do this if you explicitly enable this callback
  @impl Beamlens.Skill
  def callbacks do
    %{
      "kill_process" => fn pid_str ->
        Process.exit(pid(pid_str), :kill)
      end
    }
  end
end

Privacy & Providers

  1. BYO-Provider: Works with OpenAI, AWS Bedrock, Anthropic, and others.
  2. Resiliency: Supports advanced configuration modes like fallback models for redundancy.
  3. Privacy: Your data stays in your infrastructure; you control where the prompts are sent.

Early Access & Feedback

This is v0.2.0. It is an experiment, but I think we can do so much with this pattern.

I am also working on a Web Dashboard (showcased in the video) to visualize these investigations. :backhand_index_pointing_right: Click here to get early access to the always free web dashboard. Screenshot below:

The library is available on GitHub now. I’d love to hear your thoughts on this approach to runtime observability!

https://github.com/beamlens/beamlens

Where Next?

Popular in Announcing Top

wmnnd
Hi there, for my project DBLSQD, I needed a file storage solution that is a bit more flexible than Arc. Because I thought others might f...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New
wfgilman
I’ve cleaned up and open sourced three financial libraries I was using for my company. They are bindings for the APIs of these three comp...
New
sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
New
type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 10796 134
New
bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
384 14721 119
New

Other popular topics Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New

We're in Beta

About us Mission Statement