In this paper, we propose a novel intelligent model, called AttentiveHerb, for simulating the doctor's inquiry and prescription that is composed by a series of herbs. It can automatically simulate some principles and learns the interaction between symptoms and herbs from clinical records of traditional herbal medicine. This model consists of two different attention mechanisms for distinguishing the main symptoms and paying different attention to different symptoms. By experiments, in terms of the predicted prescriptions, 51% of the total cases are in full accordance with the labels; in 1.09% of cases, all herbs of a label can be found in the predicted prescription and the predicted prescription have other additional herbs; in 15.4% of cases, all herbs of a predicted prescription can be found in their corresponding label; in 22.41% of cases, several herbs in each predicted prescription overlap with its label; and 10.1% of cases are completely different from the label. In summary, 67.49% of the predicted prescriptions are close to the labels, and 89.9% contain the same herbs with the labels, which indicates that the prescriptions generated by our model are close to those by doctors. Besides, our model can recommend herbs that do not appear in the label prescriptions but are useful for relieving symptoms. It shows that our model can learn some interactions between herbs and symptoms. With enough normalized traditional herbal medical records, this model works more accurately. This study also provides a benchmark for the upcoming researches in intelligent inquiry and prescription generation of traditional herbal medicine.