# Sekuire Rust SDK
Rust SDK for building AI agents with the Sekuire Trust Protocol.
## Installation
Add to your `Cargo.toml`:
```toml
[dependencies]
sekuire-sdk = "0.1"
tokio = { version = "1", features = ["full"] }
```
## Quick Start
### Config-First Approach (Recommended)
Create a `sekuire.yml` file:
```yaml
project:
name: "my-agent"
version: "1.0.0"
agents:
assistant:
name: "AI Assistant"
system_prompt: "./prompts/assistant.md"
tools: "./tools.json"
llm:
provider: "openai"
model: "gpt-4-turbo"
api_key_env: "OPENAI_API_KEY"
temperature: 0.7
memory:
type: "buffer"
max_messages: 10
```
Load and use your agent:
```rust
use sekuire_sdk::get_agent;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Load agent from config
let mut agent = get_agent(Some("assistant"), None).await?;
// Chat with the agent
let response = agent.chat("Hello!", None).await?;
println!("{}", response);
Ok(())
}
```
## Features
- ✅ **4 LLM Providers**: OpenAI, Anthropic, Google, Ollama
- ✅ **Built-in Tools**: Calculator, Web Search, HTTP, File Read
- ✅ **Config-First**: Declarative YAML configuration
- ✅ **Type-Safe**: Rust's type system
- ✅ **Async**: Built on Tokio
## API Reference
### `get_agent(name, config_path)`
Load a single agent from configuration.
```rust
let agent = get_agent(Some("assistant"), Some("./sekuire.yml")).await?;
```
### `get_agents(config_path)`
Load all agents from configuration.
```rust
let agents = get_agents(Some("./sekuire.yml")).await?;
```
### `SekuireAgent`
Main agent struct with methods:
- `chat(&mut self, message, options)` - Send message and get response
- `get_history(&self)` - Get conversation history
- `clear_history(&mut self)` - Clear history
- `get_llm_provider(&self)` - Get provider name
- `get_model_name(&self)` - Get model name
- `get_tools(&self)` - Get tool names
## Built-in Tools
```rust
use sekuire_sdk::{CalculatorTool, Tool, ToolInput, create_default_tool_registry};
use std::collections::HashMap;
use serde_json::Value;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Use calculator tool
let calc = CalculatorTool::new();
let mut input = HashMap::new();
input.insert("expression".to_string(), Value::String("2 + 2".to_string()));
let result = calc.execute(input).await?;
println!("{}", result);
// Or use registry
let registry = create_default_tool_registry();
let tools = registry.list();
Ok(())
}
```
## Development
```bash
# Build
cargo build
# Test
cargo test
# Run examples
cargo run --example basic_agent
```
Standalone sample config: `examples/minimal-agent/` (`sekuire.yml`, `system_prompt.md`, `tools.json`).
## License
Apache-2.0