We all know Amazon’s Alexa can turn on your kitchen lights or order new dishwashing detergent.

Now, a University of Washington team has taught the device a new trick: To have an engaging little conversation with us, the human race.

Recently, the UW team won the Amazon-sponsored $500,000 Alexa Prize for developing the best socialbot, an algorithm that uses artificial intelligence to find interesting content for you and your Echo to talk about.

The UW bot, called Sounding Board, was able to keep a conversation going for an average of about 10 minutes.

You might wonder: Do we need to talk to our personal assistants this way?

Sure, said the UW team, in a joint phone interview from Las Vegas, where the prize was announced at an Amazon conference called AWS re: Invent 2017.

A social bot has all of the web’s knowledge at its disposal, so “it can look at a lot of articles online, read tons of facts,” said Ari Holtzman, one of three doctoral students from the Allen School of Computer Science and Engineering on the team (the others are Elizabeth Clark and Maarten Sap). “If a human wants to harvest some good ideas, interacting using voice makes a lot of sense,” he said.

You can chat with the UW’s bot about a movie you recently saw and loved, said team leader Hao Fang, a doctoral electrical-engineering student. The bot could look up the movie in a database like IMDB and hold forth on other movies the leading actor or actress starred in, and how well those films did with reviewers.

In fact, it turned out that movies were a hot topic among the many users who, perhaps unknowingly, helped pick the winner.

For months now, Amazon Echo owners who said “let’s chat” to Alexa were randomly directed to one of the three socialbots designed by the finalists: the UW, Czech Technical University in Prague, and Heriot-Watt University from Edinburgh, Scotland. In all, Amazon logged 40,000 hours of conversations with the bots.

The university teams were given text readouts of some of the conversations that didn’t go well; they were stripped of any identifying information about the user, or even what time the conversation took place.

Using that information, the teams tweaked their algorithms to make the conversations better.

One challenge: The command “stop” is what’s recommended to end a conversation with Alexa. But some users began treating Alexa like it was an old friend or family member, and gave it a complex command — for example, “Thank you very much for the wonderful conversation, but I’m going to bed to read a book now.”

The UW team had to teach the algorithm to recognize what a sentence like that actually meant. And that wasn’t easy.

The UW’s bot made use of natural inflections that humans use — for example, it could say “That’s great” with enthusiasm, or put a note of sadness when it said, “I’m sorry.” That made Alexa sound less like a robot, and “in our qualitative opinion, it definitely made a difference,” Sap said.

In fact, it was even a bit adorable, team members said.

Mari Ostendorf, the group’s primary adviser, said the students “started from scratch, with no experience building a dialogue system or working with Alexa skills.” Together, they pooled their perspectives on how language is processed and were able to reach a greater understanding of the technical and human factors that make conversation with a computer so challenging.

Along with Holtzman, Clark, Sap and Fang, the students on the team also included doctoral engineering student Hao Cheng. The three faculty advisers were Ostendorf, and professors Yejin Choi and Noah Smith, who are both part of the Allen School’s natural language processing research group. The students on the team were from the United States, China, Switzerland and Korea, and three were women, making it the most diverse team in the competition.

Team members haven’t yet decided what to do with the money, but they plan to keep refining the algorithm. Now that the competition is over, they’re hoping Amazon will continue to use their bot, although the company is expected to start up a new competition soon.

Meanwhile, they’re savoring the big win. “We’re all still in disbelief that it happened,” Holtzman said.