Build Autonomous Systems in Rust.
RustyAI gives developers the primitives to build agents that think, communicate, coordinate, and execute — with Rust's memory safety and high-performance async runtime.
Rust · Tokio · Open Source · MIT / Apache-2.0
The stack
One framework. Every layer of the agent stack.
Six independently usable crates, composed into a single facade when you want the whole thing.
The foundation for autonomous agents.
Agent, AgentId, AgentContext, lifecycle hooks, and state management. Everything an autonomous unit needs to exist, be addressed, and be driven by a runtime.
Level 0 — Foundation
Give agents actual reasoning architecture.
BDI beliefs, desires, intentions, reasoning, planning, utility functions, and intention management — a cognitive loop instead of a callback soup.
Level 1 — Reasoning
Agents need to communicate.
FIPA-inspired ACL, typed messages, bounded mailboxes, routing, and request-reply protocols with backpressure built in.
Level 1 — Transport
Coordinate agents as organizations.
Hierarchy, Swarm, Market, Coalition, Holarchy, Federation, Blackboard, and Team — reusable coordination topologies rather than bespoke glue.
Level 2 — Coordination
Run agents reliably.
Tokio-powered execution, supervision, restart policies, circuit breakers, health checks, metrics, sandboxing, and scheduling.
Level 2 — Execution
One facade for the entire framework.
A unified API and prelude that re-exports the framework's core capabilities, so a single dependency gets you the whole agent stack.
Level 3 — Facade
Cognition
Agents that don't just respond. They reason.
The cognition crate implements a BDI loop: beliefs are asserted and revised, inference derives new facts, goals are ranked by utility, plans are synthesised, and intentions are committed to and executed.
Beliefs
belief base · certainty scoring · revision
Reasoning
forward-chaining inference
Desires / Goals
utility functions · goal selection
Planning
STRIPS-style planning
Intentions
intention stack · commitment
Actions
effects executed on the runtime
use rustyai::prelude::*;let mut mind = Cognition::new();mind.beliefs.assert("shard_hot", 0.86);mind.beliefs.revise("shard_hot", Evidence::Observed);mind.desires.push(Goal::new("rebalance").utility(|b| { b.certainty("shard_hot") * 0.8});let plan = mind.plan()?;mind.intentions.commit(plan);Coordination
From one agent to an entire society.
Eight coordination patterns, each a topology you can drop onto a population of agents instead of hand-rolling orchestration.
Hierarchy
Tree-like delegation.
Swarm
Decentralized agents communicating locally.
Market
Agents bidding for work.
Coalition
Agents dynamically forming teams.
Holarchy
Nested autonomous groups.
Federation
Peer-to-peer decentralized coordination.
Blackboard
Agents sharing a common knowledge space.
Team
Fixed-role cooperative agents.
Built for Rust
The agent stack, without the overhead.
Agent systems are long-lived, concurrent, and failure-prone. Rust removes an entire class of runtime surprises before the first agent spawns.
- ›Memory safety
- ›Compile-time concurrency
- ›Zero-cost abstractions
- ›Native async
- ›Low overhead
- ›Predictable execution
Design targets
< 1 ms
agent spawn latency
< 10 µs
message passing
100k+/s
message throughput
~50 KB
baseline memory per agent
These are design targets that guide the framework's implementation, not independently verified benchmark results.
Architecture
Deliberately split into independently usable crates.
Take the facade, or depend only on the layer you need.
Hover a crate to highlight its dependencies and API role.
use rustyai::prelude::*;#[tokio::main]async fn main() -> Result<()> { let agent = AgentBuilder::new("researcher") .with_belief("rust_is_fast") .with_goal("find_solution") .build(); Runtime::new().spawn(agent).run().await}Start with one agent.
Install the facade crate, spawn an agent, and grow into a full society when you need it.