The rapid development of data analytic technologies has advanced personalized learning and increased its popularity in K-12 education significantly. Specifically, one fundamental step in personalized learning is knowledge proficiency diagnosis which reveals blind spots in students' knowledge. However, existing approaches to diagnosis either exploit data from a one-time assessment for the cognitive diagnosis (ignoring the previous historical interactions) or trace the knowledge state using recurrent neural networks to predict students' future performance (ignoring the cognitive features). To this end, this study proposes a dynamic approach to knowledge diagnosis integrating cognitive features with a key-value memory network to store latent exercise information and capture long-term temporal features based on cognitive psychology. Specifically, given the characteristics of assessment data in China, our approach mainly aims to model sequence data with cognitive features, including forgetting and learning. Two corresponding gates are used to weaken the knowledge memory and strengthen the repeated knowledge memory over time, respectively, in the memory updating process. Finally, to evaluate our approach, we conducted extensive experiments on four real-world datasets collected from K-12 education. The results show that the approach can effectively process the time sequence in education, whose prediction results are better and more stable than other existing baseline models. We also conducted experiments for parameter sensitivity, different feature integration methods, and the effectiveness of cognitive features to ensure that the models achieved the best results. The application visualization further confirms the practicability of our approach in dealing with problems of dynamic knowledge diagnosis.INDEX TERMS Cognitive features, dynamic knowledge diagnosis, key-value memory, performance prediction.