Counting visitors…
Browse all docs
Start · 9Find your path through RunifoldLearn Runifold in 45 minutesUnderstand the complete Runifold platformYour first trustworthy runChoose the right execution APIChoose crates and Cargo featuresBuild common Runifold applicationsRunifold frequently asked questionsTroubleshoot Runifold applications
Execution kernel · 7Understand RunContextCoordinate external effects safelyBound work with budgets and cancellationHandle errors and retries safelyEvents, journals, and execution evidenceDesign capability-safe executionRecover safely from checkpoints
Models & providers · 7Route across models without duplicate outputChoose and configure a providerUse the provider-neutral model protocolBuild on the Provider Runtime contractUse OpenAI control-plane and Realtime APIsTest and benchmark provider adaptersSet up OpenAI, Anthropic, Gemini, and Ollama
Agents · 7Build and configure an AgentGive an Agent typed toolsAdd conversations and semantic memoryDelegate to child Agents safelyReturn structured Rust valuesStream without losing semanticsGround an Agent with retrieval
Durable workflows · 7Compose deterministic workflowsMake workflows durableOperate durable workflow workersCoordinate timers, signals, and durable waitsRun multi-tenant workflow infrastructureRun parallel branches and safe racesVersion and evolve durable workflows
Integrations · 7Connect through MCPChoose stores and persistence boundariesExpose durable work through MCP TasksBuild and evaluate retrieval pipelinesUse MCP Resources, Prompts, and SamplingCache MCP responses without crossing authorityDeploy Runifold in a Rust web service
Quality & operations · 10Test without the networkEvaluate quality and prevent regressionsObserve the complete run treeRun safely in browsers and at the edgeRead reliability claims preciselyRun reproducible evaluations in CIOperate Runifold with SLOsGovern Task retention and deletionArchive audit evidence to S3-compatible WORM storageManage compatibility and trusted releases
Docs/Orientation
NEW TO RUNIFOLD?Build the complete mental model in 45 minutes
Orientation

Choose the right execution API

Know when to use prompt_text, prompt, stream, or run with an explicit RunContext.

Practical guide·10 min

Decision table

Choose the narrowest API that returns the information your application needs. Every option reaches the same Agent engine; the difference is how much control and evidence the caller retains.

NeedUseReturns
Final visible text onlyprompt_textString
Transcript, usage, warnings, provider eventspromptAgentOutcome
Progressive events and visible deltasstreamAgent event stream
Explicit budget, deadline, capabilities, or journalrunAgentOutcome

Rule of thumb: begin with prompt_text. Move to prompt when the response itself matters, and to run when execution policy matters.

prompt_text

Use prompt_text in application code that only needs the final user-visible answer. It builds the Agent if necessary, creates an ergonomic root run, and returns an error if either construction or execution fails.

let answer = agent
    .prompt_text("Summarize the deployment risk.")
    .await?;

This convenience path still uses Runifold's canonical execution engine. It does not bypass turn limits, registered capabilities, retries, or streaming accumulation.

prompt

Use prompt when you need the canonical outcome rather than only its text. The outcome preserves the transcript, detailed usage, warnings, and provider-specific events that cannot be normalized without loss.

let outcome = agent
    .prompt("Summarize the deployment risk.")
    .await?;
 
println!("tokens: {}", outcome.usage.tokens);
println!("answer: {}", outcome.text());

Do not reconstruct usage from text or HTTP headers. Read it from the canonical outcome so provider adapters can preserve their native accounting detail.

stream

Use stream for interactive interfaces, long-running answers, and systems that need to react to events before the model finishes.

Streaming is more than a sequence of strings. A stream can contain visible text, reasoning, tool calls, usage, warnings, raw provider events, and a terminal error. Keep consuming until the terminal state so usage and retry safety are not lost.

let mut events = agent.stream(input, &run);
 
while let Some(event) = events.next().await {
    handle_event(event?);
}

run

Use run when the application owns execution policy. Supply a RunContext with the exact budget, capabilities, deadline, metadata, and journal required for this operation.

let run = RunContext::root(
    BudgetTracker::new(Budget {
        tokens: Some(8_000),
        turns: Some(6),
        tool_calls: Some(4),
        ..Budget::default()
    }),
    capabilities,
);
 
let outcome = agent.run(input, &run).await?;

This is the production boundary for tenant budgets, request deadlines, capability attenuation, durable journaling, and shared run-tree identity.