Bootstrap Few Shot Optimizer
Bootstrap few-shot optimizer that collects execution traces from successful agent runs and produces an OptimizationArtifact with demonstrations at both strategy and subgraph levels.
For each training example, the agent is run up to maxRounds times. On success, the optimizer collects:
Strategy-level demos: full agent trajectory (via trace collection feature), with the inherited system prompt prefix stripped.
Per-subgraph demos: traces from each optimizable subgraph, automatically collected when the strategy uses
optimizableSubgraphWithTask.
The resulting OptimizationArtifact is saved to storagePath and applied to the agent via installPromptOptimization for inference.
Parameters
Maximum number of successful traces to collect.
Maximum retry attempts per training example.
Total demo slots (bootstrapped and labeled fallback).
Whether to fill the remaining slots with labeled dataset items.
File path to save/load the optimization artifact.
Seed for reproducible sampling.
Types
Persistence helpers for the bootstrapped OptimizationArtifact.
Properties
Functions
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.