Integrating intelligent drugs and personalized medicine is a transformative approach in healthcare, combining AI, genomics, and nanotechnology. This fusion aims to develop tailored medications for individual patients, utilizing dynamic drug delivery systems, targeted therapies, and dose control. It holds immense potential for improving patient outcomes and revolutionizing healthcare delivery. This article uses the CTM topic model to optimize the existing online doctor expert recommendation model. Firstly, the problem topic probability distribution is obtained based on the health questions raised by patients, and then the doctor topic probability distribution is obtained based on all the questions answered by doctors in history. Finally, a list of doctors with high topic similarity is recommended to patients. In the experimental stage, data from the Allergy Department of the Good Doctor Online Light Consultation Module was collected and processed, followed by modeling and testing. The results confirmed that the doctor recommendation method proposed in this article is more efficient than the existing recommendation methods in the department.