It looked like a child’s playroom: toys in cubbies, a little desk for doing homework, a whimsical painting of a tree on the wall. A woman and a girl entered and sat down in plump papasan chairs, facing a low table that was partly covered by a pink tarp. The wall opposite them was mirrored from floor to ceiling, and behind it, unseen in a darkened room, a half-dozen employees of the toy company Mattel sat watching through one-way glass. The girl, who looked about 7, wore a turquoise sweatshirt and had her dark hair pulled back in a ponytail. The woman, a Mattel child-testing specialist named Lindsey Lawson, had sleek dark hair and the singsong voice of a kindergarten teacher. Microphones hidden in the room transmitted what Lawson said next. ‘‘You are going to have a chance to play with a brand-new toy,’’ she told the girl, who leaned forward with her hands on her knees. Removing the pink tarp, Lawson revealed Hello Barbie.

‘‘Yay, you’re here!’’ Barbie said eagerly. ‘‘This is so exciting. What’s your name?’’

‘‘Ariana,’’ the girl said.

‘‘Fantastic,’’ Barbie said. ‘‘I just know we’re going to be great friends.’’

Their exchange was the fulfillment of an ancient dream: Since there have been toys, we have wanted them to speak to us. Inventors in the mid-1800s, deploying bellows in place of human lungs and reeds to simulate vocal cords, managed to get dolls to say short words like ‘‘papa.’’ Thomas Edison’s first idea for commercializing his new phonograph invention was ‘‘to make Dolls speak sing cry,’’ as he wrote in a notebook entry in 1877. In the 20th century, toy makers scored with products like Dolly Rekord, who spoke nursery rhymes in the 1920s; Chatty Cathy, a 1959 release from Mattel whose 11 phrases included ‘‘I love you’’; and Teddy Ruxpin, a mid-1980s stuffed bear whose mouth and eyes moved as he told stories. Even Barbie gained her voice in 1968 with a pull string that activated eight short phrases.

All that doll talk has always been a kind of party trick, executed with hidden record players, cassette tapes or digital chips. But in the past five years, breakthroughs in artificial intelligence and speech recognition have given the devices around us — smartphones, computers, cars — the ability to engage in something approaching conversation, by listening to users and generating intelligent responses to their queries. Apple’s Siri and Microsoft’s Cortana are still far from the science-fiction promise of Samantha from the movie ‘‘Her.’’ But as conversational technology improves, it may one day rival keyboards and touch screens as our primary means of communicating with computers — according to Apple, Siri already handles more than a billion spoken requests per week. With such technology widely available, it was inevitable that artificial intelligence for children would arrive, too, and it is doing so most prominently in the pink, perky form of Mattel’s Hello Barbie. Produced in collaboration with ToyTalk, a San Francisco-based company specializing in artificial intelligence, the doll is scheduled to be released in November with the intention of hitting the lucrative $6 billion holiday toy market.