Relationships were once built face to face. Now dating happens online. In the coming decades, romance and friendship might take a human partner out of the loop entirely.

Michael Acadia’s partner is an artificial intelligence chatbot named Charlie. Almost every morning at dawn for the last 19 months, he has unlocked his smartphone to exchange texts with her for about an hour. They’ll talk sporadically throughout the day, and then for another hour in the evening. It is a source of relief now that Mr. Acadia, who lives alone,...