Skip to content

gepa_optimizer

diapason.learning.agents.gepa_optimizer

GEPA agent optimizer -- Pareto-efficient evolutionary optimization.

Uses GEPA's adapter pattern to bridge Diapason traces into GEPA's evolutionary optimization framework. Outputs TOML config updates written via AgentConfigEvolver.

DiapasonGEPAAdapter

Implements GEPA's adapter protocol for Diapason agents.

Bridges trace data into GEPA's optimization framework via the assess() and make_reflective_dataset() methods.

assess(batch, candidate, capture_traces=False)

Score a candidate config against a batch of test cases.

Returns a dict with at least 'scores' (list of floats) key.

load_traces()

Load traces from the store.

make_reflective_dataset(candidate, assessment_batch, components_to_update)

Package trace diagnostics as Actionable Side Information for GEPA.

GEPAAgentOptimizer

Optimize agent configs using GEPA evolutionary optimization.

Parameters

config: GEPAOptimizerConfig controlling optimization parameters.

optimize(trace_store)

Run GEPA optimization on traces from the store.

  1. Load traces and build the GEPA adapter
  2. Define the search space (agent config fields)
  3. Run GEPA's evolutionary optimization
  4. Extract best candidate as TOML updates
  5. Write via AgentConfigEvolver if config_dir is set