For Rust devs
Native Rust. No FFI tax.
The Rust crate is the engine. Python and TS bindings are wrappers; Rust users get the runtime direct, with zero abstraction cost.
Install
cargo add agentmatic
# or in Cargo.toml:
# agentmatic = "0.1" Five-line agent
use agentmatic::prelude::*;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let agent = Agent::builder("math-helper")
.llm(OpenAI::from_env()?)
.tools(vec![calculator_tool()])
.build()?;
println!("{}", agent.invoke("What is 42 * 17?").await?);
Ok(())
} What's different from other Rust LLM crates
- Graph-first, not LLM-first.
StateGraph, channels, supersteps — the same primitives as the Python SDK, with Rust ergonomics. - Tokio-native. Runs on any Tokio runtime; no synchronous bridge.
- Zero-copy state.
Arc<Frame>snapshots; clone is cheap, mutation is COW. - Trait-based LLM providers. Implement
LlmProviderfor any backend; OpenAI / Anthropic / Bedrock are just trait impls. - No serde Value dancing. Strong types end-to-end.
Workspace structure
agentmatic = { version = "0.1", features = ["openai", "anthropic", "mcp", "postgres"] }
# Or pull individual crates:
# agentmatic-core — Pregel runtime
# agentmatic-agent — Builder + prebuilt patterns
# agentmatic-llm — Provider abstraction
# agentmatic-tools — @tool + MCP client
# agentmatic-memory — Conversation memory
# agentmatic-vectorstore — Vector store abstraction What we ship for Rust specifically
- Axum extractor — turn any agent into a route handler.
- Tower service impl — compose with retry, timeout, rate-limit middleware.
- OpenTelemetry tracing wired through
tracing. - Native FFI exports (
agentmatic-ffi) if you want to embed in Go or Java.
Ship your next agent in minutes, not weeks.
MIT licensed. Drop-in for LangGraph. Native SDKs in 5 languages. Battle-tested resilience primitives in the box.