Skip to main content

Module kernel

Module kernel 

Source
Expand description

Turn-level types for the Agent Run Kernel architecture.

This module defines the input/output contract for a single turn of agent execution:

  • TurnContext — everything the kernel needs to execute one turn (messages, tools, config, event sink).
  • TurnOutcome — the result of executing one turn (new messages, usage, finish reason, side effects).
  • AgentKernel — the stateless single-turn executor. Its run() method delegates to [crate::run_core::RunCore] which owns the ReAct step loop.

§Design

The Kernel is stateless and knows nothing about transcripts, sessions, or cross-turn state. The Wrapper (AgentRuntime) prepares a TurnContext from its transcript, calls the kernel, and then incorporates the TurnOutcome back into its state.

The kernel passes the caller’s AgentEvent channel directly to RunCore — no internal bridge (introduced in Goal 219).

Structs§

AgentKernel
The stateless Agent Kernel — a single-turn ReAct executor.
AgentKernelBuilder
Builder for AgentKernel.
TurnContext
Everything the Kernel needs to execute one turn.
TurnOutcome
The result of executing one turn.