Found in 2 comments
by nabla9
Stanislav Lem's Golem XIV published in his book Imaginary Magnitude

It might be more philosophy of AI than science fiction. It takes form of series of lectures that superintelligent (singularity level AI) gives to humanity before it goes away.

Original thread
by aflinik

Looking for a good book? Subscribe to the weekly newsletter.