An AI approach to treating diabetes