The RR intervals serve as crucial indicators for analyzing the cardiac condition of patients, with their prediction holding significant implications for the clinical assessment of cardiovascular health. Given the intricacies inherent in cardiovascular patients, traditional models encounter challenges. This study proposes an enhanced Sparrow Search Algorithm (ISSA) to optimize the Long Short-Term Memory(LSTM) network for predicting RR intervals in cardiovascular patients. Within the improved Sparrow Search Algorithm, Cat mapping, dynamic nonlinear scaling factor, crazy operator, Tent and Cauchy perturbation are introduced to enhance optimization speed and precision. ISSA is employed to capture the characteristics of RR intervals data and optimize the initial learning rate, regularization parameter, and hidden layers of LSTM. The LSTM, SSA-LSTM, ISSA-LSTM models are utilized to predict RR intervals of 30 cardiovascular patients, focusing on patients diagnosed with hypertension, arrhythmia, and chest pain. Comparative analysis reveals that ISSA-LSTM outperforms LSTM in terms of the root mean square error (RMSE) for RR intervals prediction by 65.61 %, 51.71 %, and 39.73 % for the three patient categories, respectively, and by 8.53 %, 2.15 %, and 1.34 % when compared to SSA-LSTM. Experimental results indicate that the proposed ISSA-LSTM model demonstrates favorable performance in predicting RR intervals for cardiovascular patients. © 2024 Elsevier Ltd