Accurately predicting air quality concentrations is a challenging task due to the complex interactions of pollutants and their reliance on nonlinear processes. This study introduces an innovative approach in environmental engineering, employing artificial intelligence techniques to forecast air quality in Semnan, Iran. Comprehensive data on seven different pollutants was initially collected and analyzed. Then, several machine learning (ML) models were rigorously evaluated for their performance, and a detailed analysis was conducted. By incorporating these advanced technologies, the study aims to create a reliable framework for air quality prediction, with a particular focus on the case study in Iran. The results indicated that the adaptive neuro-fuzzy inference system (ANFIS) was the most effective method for predicting air quality across different seasons, showing high reliability across all datasets.