iterative optimization of ai agent performance