With the continuous improvement of people's mental pressure and life pace, people's study and life pressure would increase, leading to the increase of people's depression. Depression is a mental illness, a chronic mental illness that is inconsistent with the patient's physical condition. In recent years, as people know more and more about depression, and they have more and more research on depression, many research scholars have provided new ideas for the treatment of depression, and this paper takes this as the research direction and research basis. This paper introduces the background of EEG (electroencephalogram, EEG) and evoked potential and artificial intelligence (Artificial intelligence, AI) methods, and then analyzes the patients with depression based on AI, and summarizes the application of electronics. The concept analysis of depression, EEG and evoked potential is put forward. At the end of the article, the application of machine learning in depression is studied. At the same time, with the continuous development of machine learning in artificial intelligence, the EEG and evoked potential related work in patients with depression are also facing new opportunities and challenges.