Dear Cat1965, I want to give you my personal opinion regarding AI and the future of mankind.
I don't think you need to be so stressed out about the catastrophy you predict, simply because I don't think AI as you predict it will be sentient anytime soon. I have worked extensively with algorithms, both in Europe and China, and am now heavily involved with developing AI in the field of Healthcare. While it might sound scary, it is actually, I think, to the benefit of mankind to have this kind of development. These tools, which are human-made (I could point you out to several studies I have in my possession that Algorithms actually are heavily influenced by the gender and culture of the developers who design them), are actually being used to help us with tasks that are now testing the very limits of our intellect (such as protein-folding, which is the holy grail of many fields of science, or in my personal case, how we can improve the success rate of Immunotherapy treatments of cancer patients).
I actually think this could be a great leap forward for mankind, as I hope it will give us the opportunity to develop other aspects of our human intelligence, which is not just about intellect. While machine-learning, deep neural networks and, in a near future, self-improving algorithms are extremely good at dealing with data, there is other aspects of our human intelligence that our societies have neglected: an algorithm will never be able to deal with emotions, and I highly doubt that AI will ever get anywhere near to being sentient or self-aware. That won't happen anytime soon, and I highly doubt that any kind of technology we develop will take their own path towards being self-relient or, as many sci-fi writers put it, deciding that humankind is no longer needed. That comes from the belief that our minds are simply dealing with 0 and 1, bits of data that our brains compute, and I think that on this forum we often raise points that show that we are SO MUCH MORE than that
That being said, we will need to reinvent our societies because, as of today, we need all these jobs for people to make a living, and the easiest-to-replace jobs are now disappearing because of automation: it leaves whole groups of people out of a living. Well maybe in the future we will be able to have a system in which automated work will be taxed to provide for the people who are denied a career because of it. As a famous comedian said in France "People want jobs, but that's not true, all they are looking for in the end is money on the table"