Troupekit and AutoAgents
AutoAgents is a Rust multi-agent framework with an actor runtime, local models and Python bindings. We compared release v0.4.0 from 2026-07-08, checked on 2026-11-28. Troupekit's middleware ideas came from AutoAgents.
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 AutoAgents
From the basic example (toolkit.rs):
#![allow(unused)]
fn main() {
use autoagents::core::agent::memory::SlidingWindowMemory;
use autoagents::core::agent::prebuilt::executor::ReActAgent;
use autoagents::core::agent::task::Task;
use autoagents::core::agent::{AgentBuilder, DirectAgent};
use autoagents::core::error::Error;
use autoagents::llm::LLMProvider;
use autoagents_derive::{AgentHooks, agent};
use autoagents_toolkit::tools::search::BraveSearch;
use std::sync::Arc;
#[agent(
name = "agent",
description = "You are a helpful agent who can search the internet for information",
tools = [BraveSearch::new()],
)]
#[derive(Clone, AgentHooks)]
pub struct SearchAgent {}
pub async fn run_agent(llm: Arc<dyn LLMProvider>) -> Result<(), Error> {
let sliding_window_memory = Box::new(SlidingWindowMemory::new(10));
let agent_handle = AgentBuilder::<_, DirectAgent>::new(ReActAgent::new(SearchAgent {}))
.llm(llm)
.memory(sliding_window_memory)
.build()
.await?;
let result = agent_handle
.agent
.run(Task::new("What is the current news related to AI in 2025?"))
.await?;
println!("Result: {:?}", result);
Ok(())
}
}
The other two parts have no counterpart at this release. We found no checkpoint or resume of a run; the memory provider is in-memory (sliding_window.rs). There is no spend cap; the ReAct executor stops after max_turns, 10 by default (react.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
| AutoAgents 0.4.0 | Troupekit 0.4 | |
|---|---|---|
| Durability | None found; memory is in-process | 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 | None; a turn cap | USD per call, per run and per period, when you set them; checked before each call |
| Tracing | Optional OpenTelemetry crate with tool-call events, and Langfuse (telemetry.md) | Own tracer, JSONL and an HTML viewer |
| Evals | Runs one prompt through several models and scores them with your function (evaluator) | Evals on the persona, checked on every run |
| Offline and on-device | llama.cpp and mistral.rs in process, and Ollama (README) | llama.cpp in process, Ollama, and a route policy per call |
| Mobile | An Android example app on llama.cpp (README); no iOS found | 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 AutoAgents is better
It ships to Python today: pip install autoagents-py, with llama.cpp CPU, CUDA and Metal extras (README), and it has MCP tools (adapter.rs) and a published Android example. Troupekit's Python binding shipped in 0.4, built from source with no PyPI package yet, and MCP comes in 0.6.
Where troupekit is different
With Storage::sqlite checkpoints a run survives a kill, and with limits set each model call is checked against a USD cap before it is sent. The check uses an estimate, so a token-dense request can cost more. Both are built in, alongside graph workflows, which AutoAgents builds as pub/sub actor topologies instead.