With the frequent occurrence of smoggy weather in recent years, air quality has begun to receive more and more public attention. The PM2.5 index is an important indicator for judging air quality. How to effectively predict the PM2.5 concentration in the air based on historical data, which has application value. And analysis of previous air quality data show that PM2.5 concentration has obvious nonlinearity and uncertain volatility, which is difficult to predict effectively with traditional machine learning algorithms. Based on the LSTM (Long Short-Term Memory) Recurrent Neural Network (RNN), this paper predicts the PM2.5 concentration for the next 5 hours based on the air data collected over the past 20 hours. Experiments show that LSTM can effectively capture the feature of time series for air quality and accurately predict the PM2.5 concentration in the future.