Harnessing pulse generation from an ultrafast laser is a challenging task as reaching a specific mode-locked regime generally involves adjusting multiple control parameters, in connection with a wide range of accessible pulse dynamics. Machine-learning tools have recently shown promising for the design of smart lasers that can tune themselves to desired operating states. Yet, machine-learning algorithms are mainly designed to target regimes of parameter-invariant, stationary pulse generation, while the intelligent excitation of evolving pulse patterns in a laser remains largely unexplored. Breathing solitons exhibiting periodic oscillatory behavior, emerging as ubiquitous mode-locked regime of ultrafast fiber lasers, are attracting considerable interest by virtue of their connection with a range of important nonlinear dynamics, such as exceptional points, and the Fermi-Pasta-Ulam paradox. Here, an evolutionary algorithm is implemented for the self-optimization of the breather regime in a fiber laser mode-locked through a four-parameter nonlinear polarization evolution. Depending on the specifications of the merit function used for the optimization procedure, various breathing-soliton states are obtained, including single breathers with controllable oscillation period and breathing ratio, and breather molecular complexes with a controllable number of elementary constituents. This work opens up a novel avenue for exploration and optimization of complex dynamics in nonlinear systems.