Crate agents_sdk

Crate agents_sdk 

Source
Expand description

§Rust Deep Agents SDK

High-performance Rust framework for composing reusable “deep” AI agents with custom tools, sub-agents, and prompts.

§Quick Start

[dependencies]
agents-sdk = "0.0.1"  # Includes toolkit by default
use agents_sdk::{ConfigurableAgentBuilder, get_default_model, create_tool};
use serde_json::Value;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // Create a simple tool
    let my_tool = create_tool(
        "greet",
        "Greets a person by name",
        |args: Value| async move {
            let name = args.get("name")
                .and_then(|v| v.as_str())
                .unwrap_or("World");
            Ok(format!("Hello, {}!", name))
        }
    );

    // Build an agent with the default Claude model
    let agent = ConfigurableAgentBuilder::new("You are a helpful assistant.")
        .with_model(get_default_model()?)
        .with_tool(my_tool)
        .build()?;

    // Use the agent
    use agents_sdk::state::AgentStateSnapshot;
    use std::sync::Arc;

    let response = agent.handle_message(
        "Please greet Alice using the greet tool",
        Arc::new(AgentStateSnapshot::default())
    ).await?;
    println!("{:?}", response);

    Ok(())
}

§Features

  • toolkit (default): Includes agents-toolkit with built-in tools
  • aws: Includes AWS integrations (DynamoDB, Secrets Manager, etc.)
  • full: Includes all features

§Installation Options

# Default installation with toolkit
agents-sdk = "0.0.1"

# Core only (minimal installation)
agents-sdk = { version = "0.0.1", default-features = false }

# With AWS integrations
agents-sdk = { version = "0.0.1", features = ["aws"] }

# Everything included
agents-sdk = { version = "0.0.1", features = ["full"] }

Modules§

agent
filesystemtoolkit
hitl
llm
messaging
persistence
Persistence traits for checkpointing agent state between runs.
prelude
Prelude module for common imports
state
todostoolkit
toolstoolkit
Helper functions for creating user tools from regular Rust functions

Macros§

tool_fntoolkit
Macro for creating tools with typed parameters (advanced usage)

Structs§

ConfigurableAgentBuilder
Builder API to assemble a DeepAgent in a single fluent flow, mirroring the Python create_configurable_agent experience. Prefer this for ergonomic construction.
DeepAgent
Core Deep Agent runtime implementation
EditFileTooltoolkit
LsTooltoolkit
ReadFileTooltoolkit
UnimplementedSecretsProvideraws
Stub Secrets Manager provider; real implementation will sit behind the aws-sdk feature.
WriteFileTooltoolkit
WriteTodosTooltoolkit

Traits§

SecretsProvideraws
Placeholder trait for loading configuration secrets.

Functions§

create_async_deep_agent
Async constructor alias to mirror the Python API surface.
create_deep_agent
Create a deep agent - matches Python create_deep_agent() API exactly
create_sync_tooltoolkit
Create a tool from a synchronous function
create_tooltoolkit
get_default_model
Returns the default language model configured Uses Claude Sonnet 4 with 64000 max tokens, mirroring the Python SDK defaults.