The affordable housing community in Jordan is finding it increasingly difficult to reconcile indoor thermal comfort and energy efficiency considerations, particularly within an arid climate. The existing models of thermal comfort, such as PMV/PPD, fail to represent dynamic interactions within the environment as well as interpersonal variations. The objectives of this work include creating a predictive model that uses machine learning and metaheuristic algorithms to predict and inform the design of the sustainable envelope of buildings. Using a set of 1336 hourly data patterns that represent actual housing envelope designs as well as environmental conditions found indoors, the Random Forest model of machine learning algorithm was used to prove the robust nature of the algorithmic approach and prove that it can create linear patterns. Five metaheuristic algorithms of PSO, GWO, Genetic Algorithm, BWO, and FA were used in combination with Random Forest for the process of feature selection and hyperparameter tuning. The algorithms were validated on the basis of R-Squared, Root Squared Error, and Mean Absolute Error on 10-fold cross-validation. The algorithm that worked best within Random Forest with PSO as the PSO algorithm contributed an overall value of R-Squared of 0.867 and an error of 0.321. The result of the research includes the design of an important model that helps influence the implementation of ML as part of an appropriate housing design within the context of climate change in that country. The findings highlight the potential of hybrid AI-driven tools to enhance energy efficiency and indoor comfort in low-income residential environments.