Swarms v2.0: The First Multi-Agent Framework in Rust
Introducing the revolutionary Rust-based multi-agent framework that delivers unprecedented performance and memory safety for enterprise AI deployments.
Introducing the revolutionary Rust-based multi-agent framework that delivers unprecedented performance and memory safety for enterprise AI deployments.
Today, we're excited to announce Swarms v2.0, the world's first production-ready multi-agent framework built entirely in Rust. This represents a monumental leap forward in AI agent orchestration, combining the performance and safety guarantees of Rust with the flexibility and power of multi-agent systems.
Rust's zero-cost abstractions and memory safety without garbage collection make it the perfect choice for high-performance AI workloads. Our benchmarks show 3-5x performance improvements over Python-based frameworks while maintaining the same level of functionality.
In enterprise environments, memory safety is non-negotiable. Rust's ownership system eliminates entire classes of bugs that can cause crashes or security vulnerabilities in production systems.
Multi-agent systems are inherently concurrent. Rust's fearless concurrency model allows us to build complex agent interaction patterns without the traditional headaches of race conditions and deadlocks.
use swarms_rs::{Agent, Swarm, Message};
#[derive(Clone)]
struct MyAgent {
id: String,
state: AgentState,
}
impl Agent for MyAgent {
async fn process_message(&mut self, message: Message) -> Vec<Message> {
// Process incoming message
match message.content {
MessageContent::Task(task) => {
let result = self.execute_task(task).await;
vec![Message::new(self.id.clone(), result)]
}
_ => vec![]
}
}
}
#[tokio::main]
async fn main() {
let mut swarm = Swarm::new();
// Add agents to the swarm
for i in 0..10 {
swarm.add_agent(MyAgent::new(format!("agent-{}", i)));
}
// Start the swarm
swarm.start().await;
}| Framework | Agent Startup | Message Latency | Memory Usage |
|---|---|---|---|
| Swarms v1 (Python) | 50ms | 2ms | 100MB |
| Swarms v2 (Rust) | 5ms | 0.2ms | 20MB |
| Improvement | 10x | 10x | 5x |
cargo add swarms-rs// Before (Python)
class MyAgent:
def process_message(self, message):
return self.handle_task(message)
// After (Rust)
impl Agent for MyAgent {
async fn process_message(&mut self, message: Message) -> Vec<Message> {
self.handle_task(message).await
}
}let config = SwarmConfig::new()
.with_max_agents(1000)
.with_message_timeout(Duration::from_secs(30))
.with_retry_policy(RetryPolicy::exponential_backoff(3));# Create a new project
cargo new my-swarms-app
cd my-swarms-app
# Add Swarms dependency
cargo add swarms-rs
# Run the example
cargo run --example basic_swarmFROM rust:1.75 as builder
WORKDIR /app
COPY . .
RUN cargo build --release
FROM debian:bookworm-slim
COPY --from=builder /app/target/release/my-swarms-app /usr/local/bin/
CMD ["my-swarms-app"]Swarms v2.0 is fully open source under the MIT license. We believe in the power of community-driven development and welcome contributions from developers worldwide.
We're actively seeking contributors in the following areas:
Swarms v2.0 represents the future of multi-agent AI systems. By leveraging Rust's performance and safety guarantees, we've created a framework that can handle the most demanding enterprise workloads while maintaining the flexibility and ease of use that developers expect.
Whether you're building a simple automation workflow or a complex distributed AI system, Swarms v2.0 provides the foundation you need to succeed.
Ready to get started? Install Swarms v2.0 today and join the revolution in AI agent orchestration.
For more information, visit swarms.ai or join our Discord community.

The Swarms Marketplace now lists more than 7,000 agents, prompts, tools, MCP servers and skills, published by more than 975 creators. A thank you to every publisher and vendor who built it, the products leading the marketplace today, and what comes next.

The Swarms Cloud Black Friday sale is live through December 2, 2026: half off your first three months of Pro or Premium, an extra 10% off the first year of an annual plan, 20% bonus credits on every top-up, $15 in free credits with the code SWARMSFLASH, and free tokens for Pro and Premium on Black Friday and Cyber Monday. This guide lists every deal with screenshots of exactly where to claim it.

The Swarms research team has published a paper on AgentRearrange, the workflow primitive of the Swarms framework. Two operators carry the whole language: an arrow runs steps in sequence and a comma runs the agents of a step in parallel, so a five-agent workflow is one string. The paper gives the grammar and execution model, compares the code the same workflow takes in LangGraph, AutoGen, LangChain, Agno and CrewAI, and releases a benchmark suite over four workflow shapes from 8 to 512 agents. On wide workflows AgentRearrange adds 37 to 42 ms of overhead at 512 agents, 2.5x less than LangGraph with function nodes, and changes topology 9x to about 100x faster than rebuilding a graph. This article walks through the paper with its charts and tables, then shows how to run the same flows with the Swarms framework and the Swarms API.