pub struct AgentRuntime { /* private fields */ }Expand description
Unified runtime that coordinates memory, graph, orchestration, and agent loop.
Implementations§
Source§impl AgentRuntime
impl AgentRuntime
Sourcepub fn builder() -> AgentRuntimeBuilder<NeedsConfig>
pub fn builder() -> AgentRuntimeBuilder<NeedsConfig>
Return a new builder in the NeedsConfig state.
Sourcepub fn quick(max_iterations: usize, model: impl Into<String>) -> Self
pub fn quick(max_iterations: usize, model: impl Into<String>) -> Self
Construct a minimal AgentRuntime in one call with sensible defaults.
Sourcepub fn metrics(&self) -> Arc<RuntimeMetrics>
pub fn metrics(&self) -> Arc<RuntimeMetrics>
Return a shared reference to the runtime metrics.
Sourcepub async fn run_agent<F, Fut>(
&self,
agent_id: AgentId,
prompt: &str,
infer: F,
) -> Result<AgentSession, AgentRuntimeError>
pub async fn run_agent<F, Fut>( &self, agent_id: AgentId, prompt: &str, infer: F, ) -> Result<AgentSession, AgentRuntimeError>
Run the agent loop for the given prompt.
Optionally recalls episodic memories and injects them into the context. Optionally enforces backpressure before starting.
§Arguments
agent_id— identifies the agent for memory retrievalprompt— the user’s input promptinfer— async inference function:(context: String) -> impl Future<Output = String>
§Returns
An AgentSession with step count, hits, duration, and a stable session ID.
Sourcepub fn memory(&self) -> Option<&EpisodicStore>
pub fn memory(&self) -> Option<&EpisodicStore>
Return a reference to the episodic memory store, if configured.
Sourcepub fn graph(&self) -> Option<&GraphStore>
pub fn graph(&self) -> Option<&GraphStore>
Return a reference to the graph store, if configured.
Sourcepub fn working_memory(&self) -> Option<&WorkingMemory>
pub fn working_memory(&self) -> Option<&WorkingMemory>
Return a reference to the working memory, if configured.
Sourcepub fn has_memory(&self) -> bool
pub fn has_memory(&self) -> bool
Return true if episodic memory was configured for this runtime.
Sourcepub fn has_working_memory(&self) -> bool
pub fn has_working_memory(&self) -> bool
Return true if working memory was configured for this runtime.
Sourcepub async fn shutdown(&self)
pub async fn shutdown(&self)
Gracefully shut down the runtime.
Logs a structured shutdown event with the final metrics snapshot.
If the persistence feature is enabled and a checkpoint backend is
configured, writes a sentinel key so operators can confirm clean shutdown.
After calling shutdown, the runtime should not be used again.