Making Artificial Intelligence Work in a Changing Environment