The main themes here remind me of a few other stories, which I'll mention/recommend as "related reading" . Full spoilers ahead:
Asimov's short story "All the Problems of the World", in the collection Nine Tomorrows
Asimov's Foundation series
Old (pseudo?)-anime Mighty Orbots