This study utilizes knowledge management (KM) to highlight a documentation-centric approach that is enhanced through artificial intelligence. Knowledge management can improve the decision-making process for predicting models that involved datasets, such as air pollution. Currently, air pollution has become a serious global issue, impacting almost every major city worldwide. As the capital and a central hub for various activities, Jakarta experiences heightened levels of activity, resulting in increased vehicular traffic and elevated air pollution levels. The comparative study aims to measure the accuracy levels of the naïve bayes, decision trees, and random forest prediction models. Additionally, the study uses evaluation measurements to assess how well the machine learning performs, utilizing a confusion matrix. The dataset’s duration is three years, from 2019 until 2021, obtained through Jakarta Open Data. The study found that the random forest achieved the best results with an accuracy rate of 94%, followed by the decision tree at 93%, and the naïve bayes had the lowest at 81%. Hence, the random forest emerges as a reliable predictive model for prediction of air pollution.