E-health sustainable systems can be optimized by empowering patients in self-care programs through artificial intelligence ecosystems in which both doctors and patients interact in an agile way. This work proposes agent-based simulators as a mechanism for predicting the repercussions of certain self-care programs in certain patients for finding the most appropriate ones. In order to make this easy for both doctors and patients, mobile agents are used to configure an app for each patient, and this app provides the resources to each self-care program. Mobile agents include a machine-learning module for learning which programs are the most appropriate for each patient. This approach is illustrated with two agent-based simulators for respectively reducing negative emotions such as depression and controlling heart rate variability extreme values related to stress. The resulting app was evaluated with a group of users with the Usefulness, Satisfaction and Ease of use (USE) scale and obtained 73% in usefulness, 77% in satisfaction, and 68% in ease of use. This trial is registered with According to the recommendations of the International Committee of Medical Journal Editors (ICMJE), this manuscript states that all experiments have been approved with the ethical committee CEICA from Community of Aragon (Spain) with registration number C.I.PI18/099.