The ability to perform nanometer-scale optical imaging and spectroscopy is key to deciphering the low-energy effects in quantum materials, as well as vibrational fingerprints in planetary and extraterrestrial particles, catalytic substances, and aqueous biological samples. These tasks can be accomplished by the scattering-type scanning near-field optical microscopy (s-SNOM) technique that has recently spread to many research fields and enabled notable discoveries. Herein, it is shown that the s-SNOM, together with scanning probe research in general, can benefit in many ways from artificial-intelligence (AI) and machine-learning (ML) algorithms. Augmented with AI- and ML-enhanced data acquisition and analysis, scanning probe optical nanoscopy is poised to become more efficient, accurate, and intelligent.