Skip to main content

Overview

Shadow Agent SDK provides a comprehensive set of features for building intelligent, autonomous agents.

Multi-LLM Provider Support

Shadow Agent SDK supports multiple LLM providers out of the box:
Full support for Claude models including Claude 3.5 Sonnet and Claude 3 Opus.
let agent = Agent::with_provider(
    Provider::Anthropic("your-api-key")
).await?;
Integration with Google’s Gemini models for diverse AI capabilities.
let agent = Agent::with_provider(
    Provider::Gemini("your-api-key")
).await?;

Built-in Tool System

Agents can use various tools to interact with their environment:

File Operations

  • Read Files: Read content from local files
  • Write Files: Create or update files
  • Glob Patterns: Search for files using glob patterns
  • Grep Search: Search file contents with regex patterns

System Integration

  • Bash Execution: Run shell commands
  • Environment Variables: Access system environment
  • Process Management: Manage subprocess execution

Model Context Protocol (MCP)

MCP Support

Connect to MCP servers to extend agent capabilities with custom tools and resources.
use shadow_agent_sdk::mcp::MCPClient;

// Connect to an MCP server
let mcp = MCPClient::connect("http://localhost:3000").await?;
agent.add_mcp_client(mcp);
Benefits of MCP:
  • Extensibility: Add custom tools without modifying the SDK
  • Standardization: Use the industry-standard protocol
  • Modularity: Mix and match different MCP servers

Async Runtime

Built on Tokio for high-performance async operations:
let mut stream = agent.execute_stream("Complex task").await?;

while let Some(chunk) = stream.next().await {
    print!("{}", chunk);
}

Logging & Observability

Comprehensive logging with tracing:
use tracing::{info, debug};

// Logs are automatically structured and filterable
info!("Agent initialized");
debug!(task = "analysis", "Starting task execution");
Configure log levels:
RUST_LOG=debug cargo run

Type Safety

Leverage Rust’s type system for reliable agent behavior:
  • Compile-time Guarantees: Catch errors before runtime
  • Zero-cost Abstractions: High-level APIs with no performance penalty
  • Memory Safety: No data races or memory leaks

Session Management

Built-in conversation and session handling:
// Maintain conversation context
let session = agent.create_session().await?;

session.send("What is Rust?").await?;
session.send("Can you give me an example?").await?;
// Agent remembers previous context

Error Handling

Rich error types with anyhow and thiserror:
use anyhow::{Result, Context};

let result = agent.execute("task")
    .await
    .context("Failed to execute task")?;

Performance

  • Async I/O: Non-blocking operations
  • Connection Pooling: Efficient API request handling
  • Stream Processing: Handle large responses efficiently
  • Zero-copy Serialization: Minimal overhead

Next Steps