The recent development of smartphone and wearable sensor technologies enable general public to carry self-tracking tasks more easily. Much work has been devoted to life data collection and visualisation to help people with better self-understanding. We believe that although (awareness/knowledge discovery is an important aspect of personal informatics, knowledge maintenance is more, or at least equally, important. In this paper, we propose a proactive approach that uses the knowledge mined from people's activity data to nudge them towards a good lifestyle (better knowledge maintenance). For demonstration purpose, a trial study was designed and implemented for good sleep maintenance. In the study, we first use smartphones as activity trackers to collect various features in a non-intrusive manner. We then use those data to learn users' activity patterns, including daily step amount, app usages, bedding time, wake-up time and sleep duration. Subsequently, we analyse correlations that may have the positive or negative impact on users' sleep qualities and finally we designed and implemented three proactive services that are able to generate customised advice in the "right" context to nudge users towards a better lifestyle. The experiments results are positive showing that with the use of the proposed services 1. daily step amount have been increased by 3.03% on average in a 10 days study and 2. sleep durations are increased by 7% for two subjects.