Objective. The purpose is to understand the depression status of the elderly in the community, explore its influencing factors, formulate a comprehensive psychological intervention plan according to the influencing factors, implement demonstration psychological intervention, and evaluate and feedback the effect, so as to provide a reference for improving the mental health of the elderly. Method. In order to make the output of different emotional data in LSTM more discriminative, a method to dynamically filter the output of LSTM is proposed. Combining the methods of Attention-LSTM, time-dimensional AI attention, and feature-dimensional AI attention, the best model in this paper is obtained. The multistage stratified cluster sampling method was used to conduct a questionnaire survey on the elderly aged 60 and above in a certain area, including the general demographic characteristics questionnaire of the elderly, the self-rating scale of mental health symptoms, and the health self-management ability of adults. All data were entered into a database using Excel software, and SPSS 19.0 statistical software was used for statistical analysis. Results/Discussion. The detection rate of depression (
GDS
≥
11
points) among the elderly in a community in a certain area was 39.38%. Multivariate logistic regression analysis showed that family history of mental illness, more negative life events, decreased ability of daily living, living alone, and suffering from physical diseases in the past six months were the risk factors for depression in the elderly. Community health education can partially alleviate depression in the elderly. The detection rate and degree of depression of the elderly in the comprehensive psychological intervention group were significantly lower than those in the control group, and the difference was statistically significant (
P
<
0.05
).