In view of the shortcomings of existing methods for predicting the settlement of surrounding buildings caused by deep foundation pit construction, this study uses the monitoring data of a foundation pit project in Shanghai and divides the construction process of the pit into three working conditions, that is, enclosure construction, earthwork excavation, and basement support construction. The attention mechanism and residual update are integrated into the artificial neural network (ANN) model, and the root-mean-square error, average absolute error, and determination coefficient are used as the evaluation indices of the model. The artificial neural network prediction model LSTM-RA-ANN for building settlements in deep foundation pit construction was then established. The prediction performance of the model was also analysed under different working conditions, and the influences of the main factors (including the soil parameter, monitoring point location, activation function, hyperparameter, and input number) on the evaluation index was further explored. The results indicate that the performances of the established LSTM-RA-ANN model are closely related to the construction conditions, the predicted settlements agree well with the monitored ones in three working conditions with the greatest errors occurring at a later time of the working conditions, and the prediction accuracy of the great–small order corresponds to basement support, enclosure construction, and earthwork excavation respectively. The farther the monitoring point is from the edge of the pit, the better the model performance is. The activation function, initial learning rate, and maximum iteration batch have a great influence on the evaluation indices of the model, while the number of input points has little effect on the evaluation indices. These results may serve as a reference for the safe construction and normal operation of foundation pit engineering.