Designing an agent framework in Rust
GIKSN will build an agent framework in Rust: messages, models, tools, a durable graph runtime with checkpoints and interrupts, a ready-made agent with middleware, and a server that runs agents over HTTP. A Go implementation will follow from the same spec. This paper sets out the design before any of it is written: the layers, the type decisions, the three places Python's flexibility doesn't translate, and how we will know the result is good enough to use.
Agent frameworks tend to start as a way to chain model calls and end up as something else: a runtime for stateful, long-running workflows. That path says something useful about what an agent framework actually is: a small core of messages, models and tools, a durable runtime underneath, and a convenient agent on top.
Our framework will have that shape from the start, in Rust. The language matters here because it changes how much the compiler can check for you.
What the framework is for
The target user is a team putting an agent into production: one that runs for minutes or hours, calls tools, pauses for human approval, survives a crash and restarts where it left off. The design goals follow from that:
- Durable by default. Every step can be checkpointed and resumed.
- Typed at the edges. Tool arguments, structured output and graph state are Rust types, not dictionaries.
- Compatible with what exists. Its traces use OpenTelemetry and its model layer talks to any OpenAI-compatible API, so existing observability tools and model servers work with it.
- Cheap to extend. Adding a model provider, a vector store or a tool should be a small, self-contained crate.
The layers
| Layer | Crate | What it holds |
|---|---|---|
| Core | core | Messages, content blocks, the model trait, the tool trait, structured output, streaming events |
| Macros | macros | #[tool] and #[derive(State)] |
| Providers | one crate each | Adapters for model APIs, plus one for any OpenAI-compatible server, including our own inference engine |
| Graph runtime | graph | State graphs, nodes, edges, branches, fan-out, interrupts, subgraphs |
| Checkpoints | plus one crate per backend |