How the 30-year-old e-commerce giant is going all-in on artificial intelligence, hoping the technology can help it update its image and beat mounting competition.