The ionosphere, crucial for satellite navigation and radio communication, is highly sensitive to solar and geomagnetic activities. Traditional ionospheric prediction models often struggle to capture its complexities. This paper introduces a Graph-Enabled Spatio-temporal transformer (GEST) model, designed to predict the Total electron content (TEC) in the ionosphere with higher accuracy. The GEST model innovatively integrates six dynamic space weather parameters, including the Kp index, and refines grid distances and weights in the Global ionospheric maps (GIM). Leveraging the efficiency of the Transformer architecture in processing spatio-temporal data, the GEST model adapts to varying ionospheric conditions and provides superior precision. Our evaluations, based on data from the Center for orbit determination in Europe (CODE), demonstrate that the GEST model significantly outperforms traditional methods and other intelligent algorithms such as conv-LSTM. It shows marked improvements in Mean absolute error (MAE), Root mean square error (RMSE), Pearson correlation coefficient (CC), and Mean absolute percentage error (MAPE), particularly during periods of intense solar and geomagnetic activity. These advancements highlight the GEST model’s substantial contributions to the field of ionospheric prediction technology, offering a robust tool for enhancing the reliability of satellite-based systems.