One of the important goals of mental health education is positive psychological quality. The current paper explores the characteristics of adolescents positive psychological quality using a survey of high school students and uses the XGBoost algorithm to determine what factors contribute to it. It is on this that ecosystem theory as an analytical model is presented and combined with artificial intelligence technology to create an ecological intervention design that would help develop positive psychological qualities in adolescents, which is then evaluated based on intervention experiments. Parenting style, academic performance, family economic situation, campus climate, and week-long time spent exercising are all characteristic important predictors of positive psychological quality development, with all having characteristic importance values of more than 0.12. Also, the intervention group showed better results, namely, the increases in five dimensions of positive psychological quality were between 15.60% and 19.97%, as compared to the pre-experiment levels. There was also a statistically significant difference between the two groups (P<0.01) and the score of each dimension was at least 15.18% higher than the control group. The results indicate that the ecological design of developing the positive psychological quality of adolescents has a high level of practical effectiveness.