| Crates.io | strands-agents |
| lib.rs | strands-agents |
| version | 0.1.0 |
| created_at | 2025-12-23 07:40:23.844022+00 |
| updated_at | 2025-12-23 07:40:23.844022+00 |
| description | A Rust implementation of the Strands AI Agents SDK |
| homepage | |
| repository | https://github.com/peitaosu/strands-rs |
| max_upload_size | |
| id | 2000966 |
| size | 772,379 |
A Rust implementation of the Strands Agents SDK for building AI agents with model-driven orchestration.
#[tool] macro[dependencies]
strands-agents = "0.1"
tokio = { version = "1", features = ["full"] }
use strands_agents::prelude::*;
use strands_agents::models::BedrockModel;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut agent = Agent::builder()
.model(BedrockModel::new("anthropic.claude-3-sonnet-20240229-v1:0").await?)
.system_prompt("You are a helpful assistant")
.build()?;
let result = agent.invoke_async("Hello!").await?;
println!("{}", result);
Ok(())
}
use strands_agents::{tool, Agent};
use strands_agents::models::BedrockModel;
#[tool]
/// Get current weather for a location.
async fn get_weather(location: String) -> String {
format!("Weather in {location}: 72°F, Sunny")
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut agent = Agent::builder()
.model(BedrockModel::default().await?)
.tool(GetWeatherTool::new())?
.build()?;
let result = agent.invoke_async("What's the weather in Seattle?").await?;
println!("{}", result);
Ok(())
}
| Feature | Description |
|---|---|
macros |
#[tool] procedural macro (default) |
s3-session |
S3-based session persistence |
otel-stdout |
OpenTelemetry stdout exporter |
otel-otlp |
OpenTelemetry OTLP exporter |
otel |
All OpenTelemetry exporters |
full |
All features |
| Module | Description |
|---|---|
agent |
Core Agent interface |
models |
Model providers (Bedrock, OpenAI, Anthropic, Ollama, etc.) |
tools |
Tool definition, execution, and MCP support |
multiagent |
Graph and Swarm patterns |
hooks |
Lifecycle hooks |
session |
Session persistence |
conversation |
Context window management |
telemetry |
Metrics and tracing |
cargo test
Licensed under the MIT License.
Rust port of Strands Agents SDK by AWS.