DEV Community

Manjunatha Sai Uppu
Manjunatha Sai Uppu

Posted on

Rust Oxide: a small Rust kernel for AI agents

Most agent code I read glues an LLM to a pile of HTTP calls, a headless browser and a scratch database, each with its own error handling and logging. When something goes wrong, nobody can say what the agent saw, what it decided, or why.

Rust Oxide is my attempt at a cleaner base: a set of Rust crates that give an agent one way to reach structured APIs and the open web, with every decision written down.

The shape of it

Three layers, all talking over one message bus:

  • Native core. oxide-k is a micro-kernel: modules register with it, exchange Command and Event envelopes over a tokio channel, and keep config in a SQLite registry. Next to it sit oxide-mirror (an event-sourced local copy of the data an agent works with, queryable with SQL) and oxide-graph (a small typed knowledge graph).
  • WASM plugins. oxide-compress cuts tokens before anything reaches a model: it keeps the fields that matter, strips metadata and chunks text by meaning. It compiles to WebAssembly, so it runs the same everywhere.
  • AI harness. oxide-browser-sh drives Chromium through the accessibility tree and retries a failed step with a different selector instead of giving up. oxide-llm-orchestrator is the one place prompts and model calls live.

Around them: oxide-gen turns an OpenAPI, GraphQL or gRPC spec into a Rust client crate, oxide-mcp-server exposes the modules as MCP tools, and oxide-mesh lets agents on different machines talk, with CRDTs for shared state.

Every decision is logged

The part I care about most is small: oxide-k::xai, an append-only log. Each entry records the actor, the action, the rationale, the inputs, the output and a confidence score. When an agent does something odd, you query the log by actor and read what it was thinking, instead of guessing from stdout.

Try it

The sister repo rust-oxide-lib has three runnable agents:

  • hello-agent boots the kernel and sends a Ping over the bus (about 110 lines).
  • news-agent runs the whole pipeline (browser, extract, compress, mirror, LLM, decision log, graph query) on mock backends, so it needs no network or API key.
  • mcp-launcher serves the browser and mirror modules as MCP tools over stdio, so Claude Code can call them.

Swapping the mocks for real Chromium and a real model changes the constructors, not the code shape.

The workspace has 150 passing tests and runs clean under clippy -D warnings. It is early, and I would like to hear where the design is wrong.

More of what I am building: manjunathasaiuppu.in.

Top comments (0)