"MY, WHAT a big mouth you have, Grandma," says Little Red Riding Hood, with just a hint of suspicion. The wolf sneezes. "Bless you," says the little girl.

Sound odd? That's because this snippet of Little Red Riding Hood was written not by a person but by a piece of software called Xapagy. It may not seem like much, but it demonstrates a first step towards computers that can invent stories. It also signals a new approach to designing a more human-like artificial intelligence.