Deterministic conversational workflows for Rust.
Website · Documentation · The Flow Map · API reference · Repository
Turnframe is a Rust library for conversational applications that change real records: a travel desk that rebooks flights, an onboarding flow that registers people, an assistant that files an expense claim. People write the way people write, in one long message that asks for three things and corrects one of them. Small language-model tasks read what the message means. Your code decides what happens.
Models propose meaning. Deterministic reducers decide effects. Committed events decide claims.
It is not an agent framework in which a model freely calls write tools. Each state of each workflow offers a closed catalog of operations, and a model can only choose among them.
Every turn runs five steps in order, and each hands the next only what it may decide.
- Persisted state determines the workflow view. A pure projector turns the stored record into one phase, its open obligations and at most one card awaiting the user.
- Small model tasks propose what a message means. A fixed chain of narrow tasks, each with a strict schema that code checks before the next one runs.
- Reducers decide effects. Every act becomes a typed command with an expected revision and an idempotency key.
- Interactions authorize consequential actions. A click on a card drawn for the record's current revision, never a model's say-so.
- Committed events determine what may be claimed. The reply says something happened only when a committed event backs it.
No understanding task needs more than a few hundred tokens of context, so the reading runs on mini and flash models. Accuracy comes from more checked calls on the same small model, not from a bigger one. Adapters for OpenAI, Anthropic, Gemini, Bedrock and Ollama ship with it, and the benchmarks say what is measured and what is not claimed.
cargo add turnframeOr run the sample travel desk, which needs no API key and no database:
git clone https://github.com/turnframe-rs/turnframe
cd turnframe && cargo run -p travel-deskThe quickstart walks one turn end to end.
Issues and pull requests are welcome on turnframe. Start with the contribution guide. Security problems go through the repository's private vulnerability reporting, as SECURITY.md describes, never through a public issue.
Turnframe is dual-licensed under MIT or Apache-2.0, at your option.