Documentation
Introduction to AgentSDK
AgentSDK is a Rust framework for building AI agents that can reason, use tools, and interact with the world. Built with type safety and performance in mind.
Overview
AgentSDK provides a composable, type-safe foundation for building AI-powered applications. Whether you're creating a simple chatbot or a complex multi-agent system, AgentSDK gives you the primitives you need without sacrificing performance or safety.
The SDK is designed around three core principles: type safety to catch errors at compile time, async-first architecture for efficient I/O, and extensibility so you can integrate any model provider or tool.
Key Features
Type Safety
Leverage Rust's type system to define tool schemas, validate inputs, and ensure correct usage at compile time. No more runtime surprises from malformed JSON or unexpected API responses.
Async First
Built on Tokio for high-performance async I/O. Handle thousands of concurrent agent sessions without blocking. Perfect for real-time applications and high-throughput services.
Extensible Tools
Create custom tools with a simple trait implementation. The SDK handles serialization, validation, and error handling automatically. Integrate with any external API or service.
Installation
Add AgentSDK to your Rust project using Cargo. The SDK requires Rust 1.75 or later.
Quick Start
Get up and running with a minimal agent in just a few lines of code.
use agents_sdk::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
let agent = Agent::builder()
.provider(Claude::new())
.system("You are a helpful assistant.")
.build()?;
let response = agent
.run("Hello, world!")
.await?;
println!("{}", response.text());
Ok(())
}Core Concepts
Understanding these fundamental concepts will help you build effective agents.
Agents
Agents are the core abstraction in AgentSDK. They combine a model provider, system prompt, and optional tools into a single entity that can process user inputs and generate responses. Agents can be configured with different behaviors, memory strategies, and tool sets.
Tools
Tools extend agent capabilities by providing structured interfaces to external functionality. Whether it's a calculator, web search, or database query, tools let agents take actions in the real world. The SDK validates tool inputs and outputs automatically.
Providers
Providers are adapters for different AI model backends. AgentSDK ships with built-in support for Claude, OpenAI, and local models via Ollama. The provider interface is simple enough that you can add support for any model API.
Memory
Memory systems allow agents to maintain context across conversations. From simple sliding window buffers to sophisticated vector stores, AgentSDK provides flexible memory abstractions that can be customized to your use case.
Examples
Explore these examples to see AgentSDK in action across different use cases.
Simple Chatbot
A basic conversational agent with memory and streaming responses.
View ExampleCode Assistant
An agent that can read, write, and execute code with file system tools.
View ExampleRAG Pipeline
Retrieval-augmented generation with vector search and document ingestion.
View ExampleMulti-Agent System
Multiple specialized agents collaborating on complex tasks.
View ExampleCommunity
Join the growing AgentSDK community to get help, share ideas, and contribute.
Next Steps
Ready to dive deeper? Here are some recommended paths to continue learning.