Skip to main content

AgentRuntime

Trait AgentRuntime 

Source
pub trait AgentRuntime: Send + Sync {
    // Required methods
    fn backend(&self) -> &AgentBackend;
    fn agent_did(&self) -> &str;
    fn validate_intent(&self, intent: &AgentIntent) -> WebizenVerdict;
    fn infer(
        &self,
        prompt: &str,
        graph_context: &str,
    ) -> Result<AgentOutput, AgentError>;
    fn validate_output(&self, output: &AgentOutput) -> WebizenVerdict;
    fn memory_budget_remaining(&self) -> u64;
}
Expand description

The core abstraction. All LLM backends MUST implement this. The trait is object-safe so it can be boxed and swapped at runtime.

Required Methods§

Source

fn backend(&self) -> &AgentBackend

Returns the configured backend variant.

Source

fn agent_did(&self) -> &str

Returns the name/DID of this agent instance for audit purposes.

Source

fn validate_intent(&self, intent: &AgentIntent) -> WebizenVerdict

Submits an intent to the Webizen for pre-flight validation. This MUST be called before infer. Callers must not proceed if the verdict is Deny.

Source

fn infer( &self, prompt: &str, graph_context: &str, ) -> Result<AgentOutput, AgentError>

Runs inference on the given prompt and graph context. graph_context is a serialised sub-graph slice provided by the Webizen.

Source

fn validate_output(&self, output: &AgentOutput) -> WebizenVerdict

Submits the LLM output to the Webizen for post-flight grounding check. The Webizen verifies provenance citations exist in the live graph.

Source

fn memory_budget_remaining(&self) -> u64

Returns remaining memory budget in bytes.

Implementors§