Skip to main content

Module runtime

Module runtime 

Source
Expand description

High-level stateful agent runtime.

Wraps the stateless AgentKernel and manages cross-turn state: transcript accumulation, usage tracking, and configuration that varies per turn (streaming, planning mode, permission hook, event sink).

§Example

use recursive::{AgentRuntime, AgentRuntimeBuilder, NullSink};

let mut rt = AgentRuntimeBuilder::new()
    .llm(my_llm)
    .tools(my_tools)
    .system_prompt("You are a helpful assistant.")
    .build()
    .unwrap();

let outcome = rt.run("What is the weather?").await.unwrap();
println!("{}", outcome.final_text.unwrap_or_default());

Re-exports§

pub use crate::runtime_goal::GoalEvaluator;
pub use crate::runtime_goal::GoalState;
pub use crate::runtime_goal::GoalStatus;
pub use crate::runtime_goal::GoalVerdict;

Structs§

AgentRuntime
A stateful agent runtime that wraps AgentKernel.
AgentRuntimeBuilder
Builder for AgentRuntime.
RuntimeOutcome
The result of a single AgentRuntime::run() turn.