garrison
Is anyone working on "AI Agents" in Elixir?
For those who are not aware, “AI agents” are, for the most part, commodity LLMs which are given access to “tools” and prompted to complete tasks, possibly in some sort of loop.
The tool use is facilitated by a program which scans the output text of the LLM and looks for a “tool call” request (in some standard format), and then executes that call. For example, you might give the model access to a “calculator” tool which enables it to do math, or a “weather API” tool to check the weather. And so on. The model is given a prompt which tells it what tools it has access to, and I believe most models coming out nowadays are trained to some degree on tool use so that they get the general idea.
The “agentic” behavior here is somewhat arbitrary, but the idea is that you have some sort of feedback loop. The model generates a tool call, receives the result, and then perhaps generates more calls based on that result. People have been using this to write code, for example, with (so far) limited success.
The current emerging “killer app” for agents is the “deep research” model, which has been adopted by google, openai, perplexity, twitter (lol), and so on. The basic idea here is that you give the model a “search engine” tool and then just prompt it to run in a loop searching, reading results, and then coming up with more searches. Then it generates a nice summary (“report”) at the end for human consumption. It goes without saying that this task is a lot easier than writing code, and as a result agents seem to be actually “catching on” for the first time.
Due to the autoregressive nature of current LLMs, which has proved to be quite sticky thus far, they perform extremely poorly for “local” use. Current autoregressive models require the entire model to be run through the GPU’s registers on every forward pass just to generate one token. As a result, “local” inference is completely bottlenecked by memory bandwidth. If you have a 30GB model (on the low end of “useful”), and a GPU with 600GB/s memory bandwidth (that’s pretty good), you would expect 20 tokens/sec (fairly usable). Unfortunately GPU memory bandwidth is expensive and 30GB is not enough for a top tier model.
However, this problem vanishes with batching. GPUs are built for parallel compute, and deep nets are built to utilize it. If you batch, say, 10 requests at a time, all of a sudden you are getting 200 tokens/sec on the same hardware (flops notwithstanding). The point being: there is a forcing function towards multitenancy. This is why everyone is using cloud APIs instead of running their own models - the cost reduction is enormous.
What this means is that “AI agents” are actually just glue code for interacting between LLM APIs and “tool” APIs. And that’s where Elixir comes in: we are very good at soft-realtime. Elixir and the BEAM are the ideal ecosystem for this. LiveView is the perfect tool for server-side realtime UI. If you were going to build some sort of “agentic” app, this would be the platform.
So I’m curious, is anyone doing something in that space?
Trending in AI / LLMs
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #performance
- #security










Most Liked
mikehostetler
Author of Jido here
I’m actively wrestling with these ideas. I’ve implemented several “Applications” with Jido now that … after finishing them … I really struggle to answer whether they are better with Jido or not. Long term - a few GenServers that wrap
reqcalls to LLM API’s are better.I have this overwhelming feeling that Jido is the right direction - but has not arrived at a sensible destination.
A few other thoughts to share:
There’s more questions then answers right now - but I do think LLM’s are here to stay so it’s better to wrestle with them
This particular space in our industry is evolving a lot right now - so I’m content to just continue wrestling and playing with the ideas. A few “first principles” I’ve collected so far:
joelpaulkoch
Hey, so I know that there are these libraries which I didn’t try yet: jido swarm_ex
And I have these blog posts open in a tab but couldn’t find the time to read them so far:
I’m sure there is more going on
nallwhy
Really enjoying this thread—so many insightful takes. I’d love to add a perspective from someone currently building a service on top of Ash and Ash AI(GitHub - ash-project/ash_ai: Structured outputs, vectorization and tool calling for your Ash application · GitHub), where we’re integrating an agent-style chatbot into a real workflow.
One thing I believe strongly:
An agent’s job is to elevate and clarify user intent, then communicate and act on it to drastically simplify the UX.
In the app I’m building, the flow looks something like this:
a user uploads a contract file and just says “process this”.
The agent then:
Internally, this feels incredibly natural and surprisingly fluid .
Where Elixir shines in this setup:
I’m still early in the journey, but this combination of structured domain logic and real-time agent orchestration feels like a powerful direction.
Last Post!
FelisOrion
Hi! I’ve seen a lot of good libraries being shared in this thread, so I’ll drop mine too
I recently made Spectre public. I’m already using it in a few products and shaping it around what has actually been useful in real applications.
Spectre is an OTP-native runtime for building agents while keeping routing, state, policies and side effects explicit. The model can propose actions, but protected actions must pass deterministic policies, and the host application still decides what is actually executed.
The idea is not to replace OTP or hide everything behind a magical framework. It is more a set of reusable building blocks around normal Elixir modules.
I’ve also made some companion libraries public:
spectre_kinetic — maps natural-language or Action Language instructions into validated function-call candidates, without executing the tools.
spectre_lens — browser interaction for agents through Lightpanda/CDP, with agent-readable page views and explicit safety boundaries.
spectre_mnemonic — working and durable memory using ETS, append-only storage, graph associations and hybrid recall.
spectre_directive — a mission planner that keeps a living plan and can correct it when new observations change the situation.
Everything is still evolving, especially the companion libraries, but I thought this was the right thread to share it.
Feedback from anyone building real agentic products in Elixir would be very welcome.