Fiber mode-locked lasers are nonlinear optical systems that provide ultrashort pulses at high repetition rates. However, adjusting the cavity parameters is often a challenging task due to the intrinsic multistability of a laser system. Depending on the adjustment of the cavity parameters, the optical output may vary significantly, including Q-switching, single and multipulse, and harmonic mode-locked regimes. In this study, we demonstrate an experimental implementation of the Soft Actor–Critic algorithm for generating a harmonic mode-locked regime inside a state-of-the-art fiber laser with an ion-gated nanotube saturable absorber. The algorithm employs nontrivial strategies to achieve a guaranteed harmonic mode-locked regime with the highest order by effectively managing the pumping power of a laser system and the nonlinear transmission of a nanotube absorber. Our results demonstrate a robust and feasible machine-learning–based approach toward an automatic system for adjusting nonlinear optical systems with the presence of multistability phenomena.