From spotting trends before they become popular and predicting what consumers are likely to buy to personalising recommendations – AI is doing a bulk of the work behind the scenes.