Abstract Background Previous publications by our team indicated a high prevalence (approximately 35%) of cognitive impairment (CI) in patients after myocardial infarction (MI). Moreover, we observed that the presence of peri-infarction deficits was not always associated with their occurrence after 6 months of follow-up and vice versa. This was the basis for distinguishing 4 groups of patients: a) group 1 – CI present peri-infarction and after 6 months; b) group 2 – CI present only peri-infarction; c) group 3 – CI present only after 6 months; d) group 4 – no CI during the study. Purpose The aim of the current study is to analyse the type of CI in patients after MI with a focus on its changes within the 4 groups mentioned. Methods The study included 326 patients hospitalised for MI treated by percutaneous coronary intervention. Cognitive function was assessed twice using the Mini–Mental State Examination (MMSE) and the Clock Drawing Test (CDT)-Shulman version during the first hospitalisation (on day 2-3 after MI) and 6 months later. In addition, the occurrence of sleep, aggression and mood disorders was assessed. The constructed research model was analysed with artificial intelligence algorithms. Results Persistent CI (group1) was found in 8.9%, peri-infarct CI (group 2) in 16.3%, and only after 6 months (group 3) in 7.7% of study participants (as assessed by MMSE). Analysis of the cognitive domains showed that in those who improve (group 2) or worsen cognitive function (group 3), analogous changes in attention function occurred, respectively improving in 81% and worsening in 100% of subjects in a given group. It was observed that there is a group of patients with a CI on the MMSE who perform CDT correctly, 12% peri-infarct and 11% at 6-month follow-up, respectively. Patients with a normal CDT score but CIs found in the MMSE have impaired attentional function regardless of the time of assessment. Conclusion CIs can occur both immediately after MI and during subsequent follow-up. However, after 6 months of intensive anti-atherosclerotic treatment (post-MI), cognitive functions improve in some patients, and deteriorate in others. At the same time, the cognitive function that undergoes similar changes in these groups is attention. The uniform type of impaired cognitive function and the lack of specific differences between the 4 groups allow us to assume a uniform etiology of cognitive deficits. Patients with normal CDT and disorders present in MMSE show deficits in attention functions. Performing CDT and using the MMSE component assessing attention function could prove sufficient for the initial assessment of cognitive functions in the population of patients after MI. The results require confirmation in a larger patient population.