cd /news/ai-agents/show-hn-troupekit-rust-framework-for… · home › topics › ai-agents › article
[ARTICLE · art-180090] src=github.com ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Show HN: Troupekit, Rust Framework for Agents That Resume After a Crash

Troupekit 0.4, an open-source Rust framework for LLM agents from developer ChaoticQubit, checkpoints every agent run into a single SQLite file so a killed process can resume where it stopped, the project's documentation states. The framework runs agents written as Rust functions via an #[agent] macro or as persona TOML files, calls Anthropic, OpenAI, Gemini and any OpenAI-compatible server or a local GGUF model through llama.cpp, and combines keyword and vector retrieval with HNSW and quantized indexes in the same SQLite file. Troupekit ships as a Rust workspace with no Python runtime, builds in CI for Linux x86_64 and aarch64, Windows, macOS, Android and iOS, and is installable with `cargo add troupekit`; a separate `troupekit-cli` crate provides `ingest` and `trace` commands.

key takeaway

Calling Troupe::builder().sqlite(path) checkpoints every agent run into one SQLite file, letting a killed process resume the run where it stopped.

read6 min views7 publishedDec 2, 2026
Show HN: Troupekit, Rust Framework for Agents That Resume After a Crash
Image: Michielbdejong (auto-discovered)

Docs · Install · Examples · API reference · crates.io

cargo add troupekit
cargo add tokio --features rt-multi-thread,macros

Troupekit is an open-source Rust framework for LLM agents that run inside your own program. You write an agent as a Rust function with #[agent], or as a persona TOML file. You give it tools, memory and documents, and you can run it in graph workflows that survive a restart.

Everything lives in one Rust workspace, with no Python runtime: agents, workflows, retrieval, memory and tracing. Stores stay in memory until you ask for durability. Call Troupe::builder().sqlite(path) and every run checkpoints into one SQLite file, and a killed process can resume the run where it stopped.

The model can be hosted or local. Troupekit calls Anthropic, OpenAI, Gemini and any OpenAI-compatible server, or runs a GGUF model on the device through llama.cpp. A route policy can pick between them for each call.

Your own documents are searchable by keyword, by vector or both, with HNSW and quantized indexes, all in the same SQLite file. CI builds the whole thing for Linux on x86_64 and aarch64, Windows, macOS, Android and iOS.

The quickest way to see it run is the bundled example, from a clone:

git clone https://github.com/ChaoticQubit/troupekit
cd troupekit
export OPENAI_API_KEY=sk-...
cargo run -p troupekit --example hello

The example is the whole program:

use troupekit::prelude::*;

/// Greet the user by name.
#[agent(model = "openai/gpt-6-luna")]
fn greeter() {}

#[tokio::main]
async fn main() -> Result<(), KitError> {
    println!("{}", greeter().run("I am Ada").await?);
    Ok(())
}

The doc comment becomes the agent's instructions. The model is a vendor/model selector from the built-in catalog in crates/troupekit-providers/catalog/providers.toml, and the key comes from <VENDOR>_API_KEY, here OPENAI_API_KEY.

crates/troupekit/examples/ has more to try. tool_agent gives an agent a #[tool]. kill_resume runs a SQLite-backed workflow that resumes after its process is killed. support_agent answers customer questions from a folder of Markdown articles; it needs --features knowledge.

To use it in your own project, add it with the cargo add lines at the top, or in Cargo.toml:

[dependencies]
troupekit = "0.4"
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }

To try unreleased changes on main, depend on the repository instead: troupekit = { git = "https://github.com/ChaoticQubit/troupekit", branch = "main" }.

The command line tool is a separate crate. Install it with:

cargo install troupekit-cli

It has two commands. troupekit ingest builds a searchable index from a folder of documents, and troupekit trace shows a trace file in the terminal or as an HTML page.

Crate What
troupekit Entry crate. use troupekit::prelude::* for the macros and builders;Troupe::builder() wires in-memory or SQLite stores and hands out a runner; re-exports the engines
troupekit-kit Ergonomic API: one builder or one macro per agent, tool and graph
troupekit-macros The #[agent] and#[tool] attribute macros
troupekit-core Messages, secrets, errors, events, ids, clock, storage traits and in-memory stores
troupekit-providers Anthropic, OpenAI, Gemini and OpenAI-compatible wire protocols, provider catalog with prices, retry, fallback and cost metering
troupekit-local On-device models: the LocalModel trait, a model catalog and llama.cpp
troupekit-tools Tool trait, validating registry, SSRF-guarded web fetch, web search over Brave and SearXNG, declarative HTTP tools
troupekit-context Memory scopes, profile facts, chunking, embeddings, hybrid retrieval and context blocks
troupekit-index Vector indexes: exact brute force and HNSW, f16 and i8 quantization, persistable pages
troupekit-agent Persona TOML agents: layered , checkpointable run, typed output, evals and LLM judge, budgets
troupekit-graph TOML workflows of agent, tool, human, router, join and end nodes, with parallel branches, human s and retries
troupekit-host Leased job queue, event log and a runner with worker and serverless step modes, crash-safe resume
troupekit-store-sqlite One SQLite file for checkpoints, memory logs, blobs, the job queue and the usage ledger; optional SQLCipher
troupekit-trace Zero-dependency trace spans, sinks and viewers
troupekit-cli The troupekit command:troupekit ingest <dir> builds a searchable index in one SQLite file,troupekit trace <file> shows a trace
troupekit-ffi-core Binding-neutral API: plain Rust handles, records and host traits that the binding crates translate
troupekit-ffi The UniFFI layer for the Swift and Kotlin bindings
troupekit-py The PyO3 layer for the Python bindings; built from source, not on crates.io

Features of the troupekit crate:

Feature Default What
kit yes The #[agent] and#[tool] macros and theAgent andGraph builders
sqlite yes SQLite stores through Troupe::builder().sqlite(path)
reqwest yes The HTTP transport for cloud providers. Turn it off to build without the TLS stack
knowledge no Document , embeddings and hybrid search for agents
sqlcipher no Encrypted SQLite with a vendored OpenSSL
sqlcipher-system no Encrypted SQLite with the system OpenSSL
local no The LocalModel trait and model catalog
llama no llama.cpp models. Needs CMake and the llama.cpp source: run cargo xtask fetch-llama or setTROUPEKIT_LLAMA_SRC

Rust 1.89 or newer for troupekit, troupekit-kit, troupekit-store-sqlite, troupekit-cli and the binding crates troupekit-ffi-core, troupekit-ffi and troupekit-py; 1.85 or newer for the other crates on crates.io.

Troupekit is at 0.4, before 1.0: the API can change between minor versions.

Release Theme A user can
0.1 Survives a restart Kill the app mid-run and resume from SQLite
0.2 Knows your docs Search local documents by keyword, vector or hybrid, and remember facts
0.3 Thinks offline Run on a local GGUF model or switch to cloud by policy, and trace a run
0.4 (current) In your app Call Troupekit from Swift, Kotlin and Python, and use Apple and Android on-device models (built from source; no SPM, Maven or PyPI package is published yet)
0.5 Works in teams Use team, crew and handoff patterns in TOML, parallel branches, and fork a run
0.6 Plugs in anywhere Use MCP tools, and expose Troupekit as an MCP server
0.7 Proven Prove workflow properties with Bend, replay runs deterministically and run evals
1.0 On-device core Meet the 1.0 acceptance criteria on Linux, Windows, macOS, Android and iOS

See CONTRIBUTING.md. Report security issues as described in SECURITY.md. Everyone taking part follows the Code of Conduct.

Licensed under either of MIT or Apache-2.0, at your option. Unless you state otherwise, any contribution you submit for inclusion is dual licensed the same way, without any additional terms or conditions.

── more in #ai-agents 4 stories · sorted by recency
── more on @troupekit 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-troupekit-ru…] indexed:0 read:6min 2026-12-02 · —