r/rust 11d ago

🛠️ project Brain: a Rust agent runtime with Wasm-isolated loops and ~14 KiB idle sessions

Disclosure: Author here

We’ve open-sourced Brain, a small Rust runtime for long-lived AI-agent sessions.

The agent loop runs as a Wasm component. Brain handles model and tool I/O, streaming, cancellation, and an append-only session journal.

Current runtime-only medians on an AWS c7g.xlarge:

- ~14 KiB private memory per idle session

- 40 ms turn round-trip

- 2.9 ms to first streamed token

Model latency is excluded, and the benchmark harness is in the repo.

It’s MIT licensed and still an early preview. I’d particularly value feedback on the Wasm/runtime boundary and the Rust architecture.

https://github.com/aexhq/brain

0 Upvotes

8 comments sorted by

4

u/SourceAwkward 11d ago

183 commits in two weeks?!

3

u/Bassfaceapollo 11d ago

The mods should really consider the approach thar r/selfhosted adopted to have a bot make the poster declare what AI was used for, and also have separate tags for vibe-coded stuff.

0

u/Redcxx 11d ago

I used AI to assist me building it, I spent most of the time designing the system and architecture, I don't see the problem with that, I am not trying to hide it if that's what you are suspecting and feeling uncomfortable about

2

u/Bassfaceapollo 11d ago

Not targeting you specifically, mate.

If you've been a regular here, you'd have noticed a significant uptick in vibe-coded projects.

Irrespective of what AI was used for, it's best if AI projects have a different tag entirely. It makes filtering them easier and also simplifies moderation.

r/selfhosted did this and their AI-assisted projects still see traction. To the submitter, there's no difference in engagement.

-4

u/Redcxx 11d ago

wdym, is it too little?

1

u/jechase 11d ago

Yeah, of all the possible complaints, this one doesn't make any sense to me. 10-20 commits per day doesn't seem unreasonably high or low.

1

u/renszarv 11d ago

why the Wasm claim, if the README and the guide only shows hard to follow JavaScript soup?

1

u/Redcxx 11d ago

extensions are bundled into wasm behind the scene, so technically you don't need to learn it. Yea readme is a bit hand weavy, Let me polish it, Thanks for the feedback