Recommender systems often generate recommendations based on user’s prior preferences. Users’ preferences may change over time due to user mode change or context change, identification of such a change is important for generating personalized recommendations. Many earlier methods have been developed under the assumption that each user has a fixed pattern. Regardless of these changes, the recommendation may not match the user’s personal preference and this recommendation will not be useful to the user based on the current context of the user. Context-aware recommender systems deal with this problem by utilizing contextual information that affects user preferences and states. Using contextual information is challenging because it is not always possible to obtain all the contextual information. Also, adding various types of contexts to recommender systems increases its dimensionality and sparsity. This paper presents a novel hierarchical hidden Markov model to identify changes in user’s preferences over time by modeling the latent context of users. Using the user-selected items, the proposed method models the user as a hidden Markov process and considers the current context of the user as a hidden variable. The latent contexts are automatically learned for each user utilizing hidden Markov model on the data collected from the user’s feedback sequences. The results of the experiments, on the benchmark data sets, show that the proposed model has a better performance compared to other methods.