Students who are able to maintain attention in an activity present a better performance in school activities. The ability to focus on an activity is essential for the student to perform satisfactorily at school. Over the last two decades there has been an increase interest in studies on mindfulness and its positive effects on health, well-being and improvement of cognitive abilities. In the school context, mindfulness has shown to be a relevant technique for the improvement of the students’ attention. Recent studies show that performing mindfulness sessions provides the student with improved attention, school performance, control of emotions, and relationships with teachers and peers. Although there are also a growing number of researches that uses computational resources to encourage the practice of mindfulness, there are few works that integrate the use of mindfulness in intelligent tutors systems or in other types of learning environments. In addition, none of the works proposes a personalized training to the characteristics of the learner. The present work proposes an agent that provides exercises of mindfulness that are guided and adapted to the students’ mood and their experience in meditation. Through the data collected by the system, it is possible to select the most appropriate exercises for the student, as well to adjust the duration of the exercises. The agent aims to encourage the student to practice meditation techniques to improve attention and academic achievement and promote the general well-being of the student. As a case study, this agent was integrated to PAT2Math, an algebra intelligent tutoring system, for the evaluation with 41 students for 7 weeks. For evaluation purposes, 3 versions of the PAT2Math intelligent tutoring system were used. The first version used audios with narratives of meditation techniques without adaptation to the experience or mood presented by the student; the second version used 3 audio recordings that told the story of algebra and equations. The third and final version used 24 audio recordings with different meditation techniques and different durations so that the techniques used could be adapted to the student's experience and mood. The results of the evaluation showed that the practice of mindfulness in a guided and personalized way improves the attention of the student. However, possibly due to the duration of the experiment, no statistically significant evidence of a positive impact on student learning was found.