@@ -313,6 +313,19 @@ class EvaluatorConfig:
313313 max_artifact_storage : int = 100 * 1024 * 1024 # 100MB per program
314314
315315
316+ @dataclass
317+ class EvolutionTraceConfig :
318+ """Configuration for evolution trace logging"""
319+
320+ enabled : bool = False
321+ format : str = "jsonl" # Options: "jsonl", "json", "hdf5"
322+ include_code : bool = False
323+ include_prompts : bool = True
324+ output_path : Optional [str ] = None
325+ buffer_size : int = 10
326+ compress : bool = False
327+
328+
316329@dataclass
317330class Config :
318331 """Master configuration for OpenEvolve"""
@@ -330,6 +343,7 @@ class Config:
330343 prompt : PromptConfig = field (default_factory = PromptConfig )
331344 database : DatabaseConfig = field (default_factory = DatabaseConfig )
332345 evaluator : EvaluatorConfig = field (default_factory = EvaluatorConfig )
346+ evolution_trace : EvolutionTraceConfig = field (default_factory = EvolutionTraceConfig )
333347
334348 # Evolution settings
335349 diff_based_evolution : bool = True
@@ -355,7 +369,7 @@ def from_dict(cls, config_dict: Dict[str, Any]) -> "Config":
355369
356370 # Update top-level fields
357371 for key , value in config_dict .items ():
358- if key not in ["llm" , "prompt" , "database" , "evaluator" ] and hasattr (config , key ):
372+ if key not in ["llm" , "prompt" , "database" , "evaluator" , "evolution_trace" ] and hasattr (config , key ):
359373 setattr (config , key , value )
360374
361375 # Update nested configs
@@ -378,6 +392,8 @@ def from_dict(cls, config_dict: Dict[str, Any]) -> "Config":
378392 config .database .random_seed = config .random_seed
379393 if "evaluator" in config_dict :
380394 config .evaluator = EvaluatorConfig (** config_dict ["evaluator" ])
395+ if "evolution_trace" in config_dict :
396+ config .evolution_trace = EvolutionTraceConfig (** config_dict ["evolution_trace" ])
381397
382398 return config
383399
@@ -446,6 +462,15 @@ def to_dict(self) -> Dict[str, Any]:
446462 "use_llm_feedback" : self .evaluator .use_llm_feedback ,
447463 "llm_feedback_weight" : self .evaluator .llm_feedback_weight ,
448464 },
465+ "evolution_trace" : {
466+ "enabled" : self .evolution_trace .enabled ,
467+ "format" : self .evolution_trace .format ,
468+ "include_code" : self .evolution_trace .include_code ,
469+ "include_prompts" : self .evolution_trace .include_prompts ,
470+ "output_path" : self .evolution_trace .output_path ,
471+ "buffer_size" : self .evolution_trace .buffer_size ,
472+ "compress" : self .evolution_trace .compress ,
473+ },
449474 # Evolution settings
450475 "diff_based_evolution" : self .diff_based_evolution ,
451476 "max_code_length" : self .max_code_length ,
0 commit comments