Pure-Rust async runtime for LLM agents. Multi-provider (Anthropic/OpenAI/Ollama), tool-capable end-to-end, structured permissions, real MCP support, USD cost tracking, Files API, optional FS+search tool pack.
README
agent-rsMulti-provider · tool-capable end-to-end · structured permissions · real MCP · zero unsafe.
┌─ user ──┐ ┌─── QueryLoop ───────────────────────────────────────┐
│ prompt │───▶│ Streaming → ToolDispatch → ToolCollecting → Yield │──▶ Event::*
└─────────┘ │ ↑ │ │
│ └──── auto-compact / hooks / cost ◀─────┘ │
└─────────────────────────────────────────────────────┘
│ │ │ │
▼ ▼ ▼ ▼
Anthropic OpenAI-* Ollama MCP servers
(SSE) (compat) (local) (stdio / HTTP)
</div>
use agent::prelude::*;
use std::sync::Arc;
let provider = Arc::new(AnthropicProvider::new(std::env::var("ANTHROPIC_API_KEY")?));
let engine = QueryEngine::new(provider, "claude-opus-4-7").with_system("Be concise.");
let mut stream = engine.run("Summarize Rust's borrow checker in two lines.", AbortController::new()).await?;
while let Some(event) = futures::StreamExt::next(&mut stream).await {
if let Event::TextDelta { delta } = event? { print!("{delta}") }
}