Mastering Batch Optimization Agents in AI Workflows