Troupekit and yoagent
yoagent is a Rust agent loop with streaming events, tools, MCP and budgets. It came up in our searches for Rust agent frameworks on 2026-11-28. We compared release v0.27.9 from 2026-11-15, checked on 2026-11-28.
The same agent
The test agent is small on purpose: a persona, one tool, a run that is killed and resumed, and a spend cap.
In yoagent
The README example sets a persona and registers the built-in tool set; we found no shorter example with exactly one tool (README):
use yoagent::provider::ModelConfig;
use yoagent::{tools, Agent, AgentEvent, StreamDelta};
#[tokio::main]
async fn main() {
// The provider is selected from the config's protocol and the key is read
// from ANTHROPIC_API_KEY. Call `.with_api_key(k)` to pass one explicitly.
let mut agent = Agent::from_config(ModelConfig::claude_sonnet_5())
.with_system_prompt("You are a coding assistant.")
.with_tools(tools::default_tools());
let mut events = agent.prompt("Find every TODO in src/ and summarise them").await;
while let Some(event) = events.recv().await {
match event {
AgentEvent::MessageUpdate { delta: StreamDelta::Text { delta }, .. } => print!("{delta}"),
AgentEvent::ToolExecutionStart { tool_name, .. } => println!("\nā¶ {tool_name}"),
AgentEvent::AgentEnd { .. } => break,
_ => {}
}
}
agent.finish().await;
}
To continue in a new process, your app saves the messages with agent.save_messages() and restores them later with agent.restore_messages(..); the app decides when to save (persistence.md). The spend cap is a Budget extension in USD, with .across_runs() for one total per session; it stops once spend reaches the limit, and "the request that crosses the limit still completes" (extension_budget.rs).
In troupekit
The persona is the doc comment and the tool is a #[tool] function. This is the tool_agent example:
#![allow(unused)]
fn main() {
/// Adds numbers with the add tool.
#[agent(model = "openai/gpt-6-luna", tools = [add])]
fn calc() {}
}
A role, a goal, evals, a spend cap of 5 000 millionths of a dollar per run and the checkpoint store are keys on the same macro. This one is from a test of the kit:
#![allow(unused)]
fn main() {
#[agent(
model = "fake/m",
role = "Checks facts.",
goal = "A short answer.",
display_name = "Fact Checker",
evals = ["min_items(items, 1)"],
limits = Limits { run: Some(5_000), ..Limits::default() },
checkpoints = Storage::memory(),
max_turns = 3,
max_tokens = 256,
retries = 1,
laws = "tests/fixtures/rules.bend",
auto_laws = false,
)]
}
In 0.4 the laws key is validated at build and not enforced by the run (Proofs and laws). With the SQLite store as checkpoints, a new process resumes a killed run by its id. This is the kill_model_call example, which is killed in the middle of a local model call:
#![allow(unused)]
fn main() {
("resume", Some(id)) => {
let run_id: RunId = serde_json::from_str(&format!("\"{id}\""))?;
let text = built.resume(run_id).await?;
println!("RESUMED {}", text.len());
}
}
Nothing else is needed: no server, no second process to run the engine, no Python. Durable runs and Spend limits say what each part guarantees.
Side by side
| yoagent 0.27.9 | Troupekit 0.4 | |
|---|---|---|
| Durability | Save and restore messages yourself; a crash is recorded, not resumed (gasp.md) | Checkpoint after every step and resume by run id in a new process, once checkpoints use Storage::sqlite; the default in-memory store is lost when the process exits |
| Spend limits | USD Budget, checked before each request on the spend so far, and a total-token cap (context.rs) | USD per call, per run and per period, when you set them; checked before each call on an estimate that counts the full max_tokens of output but only approximates input as a quarter of the request's JSON bytes |
| Tracing | tracing spans with tokens and cost per model stream (telemetry.md) | Own tracer, JSONL and an HTML viewer |
| Evals | None for users; a mock provider for tests | Evals on the persona, checked on every run |
| Offline and on-device | Ollama (README); no in-process model | llama.cpp in process, Ollama, and a route policy per call |
| Mobile | None found; builds for wasm32 (README) | Builds for iOS and Android in CI; Swift and Kotlin bindings since 0.4, built from source |
| Single binary | Yes, it is a Rust library | Yes, it is a Rust library |
Where yoagent is better
It runs in a Cloudflare Worker on wasm32 as well as natively, and ships MCP over stdio and HTTP (mcp.md) and tool-call approval middleware today. Troupekit has neither wasm32 nor MCP yet, and it pauses for a person at a human node in a workflow, not on each tool call.
Where troupekit is different
With Storage::sqlite checkpoints the run itself is durable rather than the message list, and a cap you set is checked before a call goes out, so a call the estimate says would cross it is not sent. Input tokens are estimated, and a shared period cap is enforced only among runs in one process that share a ledger. The model can also run in the same process.