AgentOptimizer

Common contract for agent optimizers: algorithms that improve a GraphAIAgent by learning from execution trajectories collected over a training dataset.

An implementation runs in two phases. train executes the base agent over a dataset, scores the trajectories with a caller-supplied metric, and persists optimizer-specific artifacts to disk. loadOptimizedAgent then reads those artifacts and applies them to a base agent.

Parameters

Input

the agent input type.

Output

the agent output type.

InputLabel

the golden-label type associated with each dataset item (see TrainSetItem).

Inheritors

Functions

Link copied to clipboard
abstract fun loadOptimizedAgent(baseAgent: GraphAIAgent<Input, Output>): GraphAIAgent<Input, Output>

Loads training artifacts produced by train and applies them to the given baseAgent.

Link copied to clipboard
abstract suspend fun train(session: TrainingSession<Input, Output, InputLabel>): TrainingResult

Trains the agent using the provided session, which gives access to a TrainingSession.use block where the training scope (agent, dataset, tracked execution methods) is available.