Artificial servants, autonomous killing machines, surveillance systems, and sex robots have been part of the human imagination for thousands of years.