I was thinking Jack Vance’s “The Dying Earth,” except not a billion years from now.
I never considered magic as Science Fiction so, it wasn't ever on my reading list.
I don't agree with all that is presented in this video from a couple of years has some interesting thoughts.
AI robot terrifies officials, explains our illusion, with Elon Musk.