Skip to main content

AgentKernel

Trait AgentKernel 

Source
pub trait AgentKernel: Send {
    // Required methods
    fn start<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        request: RunRequest,
        context: &'life1 RunContext,
    ) -> Pin<Box<dyn Future<Output = Result<AgentAction, AgentError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn observe<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        observation: Observation,
        context: &'life1 RunContext,
    ) -> Pin<Box<dyn Future<Output = Result<AgentAction, AgentError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Step-wise agent kernel boundary.

A kernel maintains reasoning state and decides the next action. It does not execute provider requests or side effects directly; an outer runtime drives those actions and feeds successful observations back through observe.

Required Methods§

Source

fn start<'life0, 'life1, 'async_trait>( &'life0 mut self, request: RunRequest, context: &'life1 RunContext, ) -> Pin<Box<dyn Future<Output = Result<AgentAction, AgentError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Starts a run and returns the first action.

Source

fn observe<'life0, 'life1, 'async_trait>( &'life0 mut self, observation: Observation, context: &'life1 RunContext, ) -> Pin<Box<dyn Future<Output = Result<AgentAction, AgentError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Consumes an observation and returns the next action.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§