█████╗ ██████╗ ███████╗███╗ ██╗████████╗███████╗ ███████╗██████╗ ██╗ ██╗ ██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝██╔════╝ ██╔════╝██╔══██╗██║ ██╔╝ ███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║ ███████╗ ███████╗██║ ██║█████╔╝ ██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ ╚════██║ ╚════██║██║ ██║██╔═██╗ ██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ███████║ ███████║██████╔╝██║ ██╗ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝ ╚══════╝╚═════╝ ╚═╝ ╚═╝ █████╗ ██████╗ ███████╗███╗ ██╗████████╗███████╗ ███████╗██████╗ ██╗ ██╗ ██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝██╔════╝ ██╔════╝██╔══██╗██║ ██╔╝ ███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║ ███████╗ ███████╗██║ ██║█████╔╝ ██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ ╚════██║ ╚════██║██║ ██║██╔═██╗ ██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ███████║ ███████║██████╔╝██║ ██╗ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝ ╚══════╝╚═════╝ ╚═╝ ╚═╝

A Rust SDK for AI Agents

Updating crates.io index
Adding agentsdk v0.1.0
Compiling agentsdk v0.1.0
Finished in 4.52s

Get Started

$ cargo add agents-sdk

Works with these providers

OpenAI
Anthropic
Gemini
Ollama
Grok
Mistral
Local
OpenAI
Anthropic
Gemini
Ollama
Grok
Mistral
Local

Why agents-sdk

Zero-Cost Abstractions

Compile-time checked agent definitions. No reflection, no runtime overhead. Pure Rust performance.

Multi-Model Routing

Route tasks across providers with automatic fallbacks. Cost and latency-aware scheduling built in.

Type-Safe Tools

Derive macros for tool schemas. Full serde integration with automatic validation.

Tracing Integration

First-class tracing support. Export to OpenTelemetry, Jaeger, or any tracing subscriber.

Async Streams

Native async/await with tokio. Stream responses, handle backpressure, cancel anytime.

Memory Safe

Rust's guarantees extend to your agents. No data races, no null pointers, no surprises.

Performance

M3 Max, 64GB RAM · Claude Sonnet 4 · 1000 iterations
Cold Start
2.3ms
47x faster
agents-sdk
2.3ms
LangChain
108ms
LlamaIndex
89ms
Memory
12MB
18x lighter
agents-sdk
12MB
LangChain
218MB
LlamaIndex
164MB
Throughput
8.4kreq/s
12x faster
agents-sdk
8.4k
LangChain
680
LlamaIndex
920

Architecture

Your Application

Where agents-sdk integrates

1
Tauri AppCLI ToolBackend Service

agents-sdk

RUST

Native Rust core

2
Agent RuntimeTool EngineContext ManagerStream Processor

Native Tools

Built from scratch in Rust

3
Shell ExecutorFile OperationsCode IntelligenceGit Integration

Providers

Swappable LLM backends

4
AnthropicOpenAIOllamaCustom
NativeRUSTalternative to
Claude CodeTS
Codex CLITS
OpenCodeTS

How we compare

First Native Rust Agent SDK
Language
agents-sdk
Rust
Claude Agent SDK
TypeScript / Python
Codex CLI
TypeScript
OpenCode
TypeScript
Type Safety
agents-sdk
Compile-time
Claude Agent SDK
Runtime (TS)
Codex CLI
Runtime
OpenCode
Runtime
Memory Safety
agents-sdk
Guaranteed
Claude Agent SDK
GC-based
Codex CLI
GC-based
OpenCode
GC-based
Async Runtime
agents-sdk
tokio
Claude Agent SDK
Node / asyncio
Codex CLI
Node.js
OpenCode
Node.js
Native Binary
agents-sdk
Single binary
Claude Agent SDK
Requires runtime
Codex CLI
Requires Node
OpenCode
Requires Node
Tauri Integration
agents-sdk
Native
Claude Agent SDK
Via IPC
Codex CLI
Via IPC
OpenCode
Via IPC
Tool System
agents-sdk
Derive macros
Claude Agent SDK
Function schema
Codex CLI
Function schema
OpenCode
Function schema
Streaming
agents-sdk
Zero-copy
Claude Agent SDK
Codex CLI
OpenCode
Cold Start
agents-sdk
~2ms
Claude Agent SDK
~150ms
Codex CLI
~120ms
OpenCode
~100ms
Binary Size
agents-sdk
~4MB
Claude Agent SDK
~80MB+
Codex CLI
~60MB+
OpenCode
~50MB+
v0.4.0latest
Jan 20, 2026

Multi-model routing & cost tracking

  • New Router trait for custom model selection logic
  • Built-in cost tracking per provider with budget limits
  • Automatic fallback chains when primary model fails
  • Gemini 2.0 provider support
v0.3.2stable
Jan 8, 2026

Streaming improvements

  • Zero-copy streaming with Pin<Box<dyn Stream>>
  • Backpressure handling for slow consumers
  • Fixed memory leak in long-running streams
v0.3.0stable
Dec 15, 2025

Tool system overhaul

  • New #[derive(Tool)] macro with automatic schema generation
  • Validation via validator crate integration
  • Async tool execution with timeout support
  • MCP server compatibility layer
v0.5.0-betabeta
Coming Feb 2026

Multi-agent orchestration

  • Agent-to-agent communication primitives
  • Supervisor pattern with delegation
  • Shared memory between agents
  • Visual workflow builder integration

Quick Start

main.rs
1use agents_sdk::{Agent, Tool};
2
3// Define a tool with derive macro
4#[derive(Tool)]
5struct SearchTool {
6 query: String,
7}
8
9#[tokio::main]
10async fn main() -> Result<()> {
11 let agent = Agent::builder()
12 .model("claude-sonnet-4")
13 .tool(SearchTool::default())
14 .build()?;
15
16 let response = agent
17 .run("Find recent Rust news")
18 .await?;
19
20 println!("{}", response);
21 Ok(())
22}
Cargo.toml
1[package]
2name = "my-agent"
3version = "0.1.0"
4edition = "2024"
5
6[dependencies]
7agents-sdk = "0.4"
8tokio = { version = "1", features = ["full"] }
9
10# Optional: enable specific providers
11[features]
12default = ["anthropic"]
13anthropic = []
14openai = []
15ollama = []