Perhaps your friends already have shown you this video from the past month of someone activating both an Amazon Echo and a Google Home device, and then standing back as the two products of artificial intelligence, Alexa and Google, talk to each other in an almost infinite loop.

But someone programmed these devices to come up with appropriate answers.

Our world in 2016 isn’t quite what filmmakers imagined in 2001: A Space Odyssey (“Open the pod bay doors, HAL”), or even the 2013 movie, Her, in which a human fell in love with his AI operating system, but it can provide slightly humorous interactions such as the ones Grace Gummer’s character has had with her own Alexa in the TV series, Mr. Robot (not a spoiler!).

Who did that? And how do they decide to give Alexa and Google a sense of humor, and how funny should they be, anyhow?

Katherine Schwab at Co.Design did some digging, for her article today, “The Daunting Task of AI Funny.” 

“Humans in the flesh world don’t enjoy conversations with dry boring people, so why would we want that from our artificial intelligence?” says Sarah Wulfeck, creative director and writer at Pullstring, a company that builds chatbots for companies and entertainment franchises. “If they’re dry and they can’t say something that is potentially funny or intriguing or something that triggers an emotion, the question of why have a conversation with them comes into play.”

However, humor can serve another purpose: to ease user disappointment when the bot inevitably doesn’t understand you. Consider it a handy way to distract users from the shortcomings of conversational UIs. Co.Design spoke with the writers and designers behind Google Assistant, Amazon’s Alexa, Poncho the weather bot, and more about the process of building personality into their products—and why it’s a design challenge worth tackling.

Schwab found that these companies often are hiring improvisers (who already have reprogrammed themselves to adapt to new dialogues) from places such as the Upright Citizens Brigade Theatre, screenwriters, stand-ups and writers from The Onion.

Since every human customer has a different sense of humor, programming the chatbots requires some additional thought.

“Some people want her to be a digital George Carlin and push the boundaries,” says Farah Houston, senior manager for the Alexa experience. “Some people think she’s veering toward too edgy, and they are concerned about what that means for children in their household who might overhear. Some people want her to flip sass at them at every opportunity, but others don’t.”

Much like writing for a TV show or host, it also allows comedians to write in a different voice than their own.

“I say things I can get away with with Poncho that I couldn’t in my own stand-up,” says Austin Rodrigues, one of the writers on the bot’s editorial team who does comedy at the Upright Citizens Brigade Theater in New York. “People expect an internet cat to make puns.” On Thanksgiving, Poncho messaged me to inform me that his “BFFs (bot friends forever)” were in town. On Wednesday morning, he quipped, “It’s only *sort of* raining & I’m only *sort of* meeting company dress code today.”

Read Schwab’s entire article at Co.Design.