top | item 44228064

(no title)

pantsforbirds | 8 months ago

I've been messing around with an Elixir + BEAM based agent framework. I think a mixture of BEAM + SQLite is about as good as you can get for agents right now.

You can safely swap out agents without redeploying the application, the concurrency is way below the scale BEAM was built for, and creating stateful or ephemeral agents is incredibly easy.

My plan is to set up a base agent in Python, Typescript, and Rust using MCP servers to allow users to write more complex agents in their preferred programming language too.

discuss

order

nilslice|8 months ago

you should check out the Extism[0] project and the Elixir SDK[1]. This would allow you to write the core services, routing, message passing, etc in Elixir, and leverage all the BEAM/OTP have to offer, and then embed "agents" written in other languages which are small Wasm modules that act like in-process plugins.

[0]: https://github.com/extism/extism [1]: https://github.com/extism/elixir-sdk

pantsforbirds|8 months ago

That's a really interesting idea. My original thought was to use MCP as the way to define other agents, but I'll have to do some more research into extism!

alberth|8 months ago

Any reason for SQLite use, instead of the BEAMs built-in mnesia data store?

https://www.erlang.org/doc/apps/mnesia/mnesia.html

pantsforbirds|8 months ago

I'm still in the exploration/experimentation stage of the project, but I'm currently using a mixture of SQLite, PostgreSQL, S3, and DuckDB.

My original thought was to spin up SQLite databases as needed because they are super lightweight, well-tested, and supported by almost every programming language. If you want to set up an agent in another programming language via MCP, but you still want to be able to access the agent memory directly, you can use the same schema in a SQLite database.

I may end up using mnesia for more metadata or system-oriented data storage though. It's very well designed imo.

But one of the biggest reasons has just been the really nice integration with DuckDB. I can query all of the SQLite databases persisted in a directory and aggregate some metadata really easily.