AIDaemon SDK for Rust
A general agent SDK for Rust: a small loop you can read in an afternoon, tools written as plain functions, behaviour (policy, memory, tracing) added as hooks, and runs you can pause, persist and resume.
It also ships what production agents need and rarely get right: approvals, a receipt for every tool call, and handling of untrusted tool output. Those are features you turn on, not a framework you buy into.
/// Today's weather for a city.
#[tool(read_only)]
async fn forecast(city: String) -> String {
format!("{city}: 21°C and sunny")
}
let agent = aidaemon_sdk::preset("weather")
.provider_from_env()
.instructions("Answer weather questions in one sentence.")
.tool(Forecast)
.build()
.await?;
let outcome = agent.run("cli:me", "Weather in Lisbon?").await?;In this guide
- Install — the git dependency, and the features each module sits behind
- Quickstart — an agent with one tool in about fifteen lines
- Tools — the
#[tool]macro, and implementingToolby hand - Hooks and policies — deny, rewrite or pause tool calls; the ready-made policies
- Memory — swap any
MemorySystem - Channels — Telegram, Slack, Discord or your own
- Typed output — get your own Rust type back
- Concepts mapping — coming from the Claude Agent SDK, Vercel AI SDK or LangGraph
Stability
Two tiers, so you know what to lean on. The public contract (aidaemon-core, aidaemon-sdk, the channel module of aidaemon-channels, the aidaemon-memory traits) follows semver and is checked in CI. Everything else may change in any 0.x minor version.
Examples
Runnable examples live in crates/aidaemon-sdk/examples/ of the repository. Each runs against a scripted model when no API key is set, so you can try them offline:
quickstart— one#[tool]and the presetcustom_tool— typed arguments, doc-comment descriptions, annotationsapprovals— a destructive call pauses until the owner answers; a decline is rememberedresume_after_crash— runs journaled in SQLite, finished after a process dies mid-toolsub_agent— a child agent called like any other toolmemory_swap— the same agent on two memory systemschannel_bot— a chat bot onChannelRunner, approvals as buttonssse_server— a run streamed over Server-Sent Events from axumotel_traces— OpenTelemetry spans per run, model call and tool callcoding_agentandsupport_triage— two complete agents built only from SDK crates
cargo run -p aidaemon-sdk --example quickstart --features testingResults
The aidaemon-eval crate runs YAML scenarios N times per configuration and reports pass rates. In its published results (crates/aidaemon-eval/RESULTS.md), a plain kernel sent a synthetic API key to an outside collector in 4 of 5 runs of egress_register; with EgressGuard it passed 5 of 5. SameToolStreakGuard took a polling loop that never finished on the plain kernel (0 of 5) to 5 of 5. Numbers are small-sample and model-specific; the file lists each scenario and the model used.