Artificial intelligence is one of the efficient methods that can be developed to simulate nonlinear behavior and predict the response of building structures. In this regard, an adaptive method based on optimization algorithms is used to train the TSK model of the fuzzy inference system to estimate the seismic behavior of building structures based on analytical data. The optimization algorithm is implemented to determine the parameters of the TSK model based on the minimization of prediction error for the training data set. The adaptive training is designed on the feedback of the results of previous time steps, in which three training cases of 2, 5, and 10 previous time steps were used. The training data is collected from the results of nonlinear time history analysis under 100 ground motion records with different seismic properties. Also, 10 records were used to test the inference system. The performance of the proposed inference system is evaluated on two 3 and 20-story models of nonlinear steel moment frame. The results show that the inference system of the TSK model by combining the optimization method is an efficient computational method for predicting the response of nonlinear structures. Meanwhile, the multi-vers optimization (MVO) algorithm is more accurate in determining the optimal parameters of the TSK model. Also, the accuracy of the results increases significantly with increasing the number of previous steps.