Controlling complex systems with artificial intelligence