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!

28 Likes