This paper investigates the smart energy management of a building using artificial intelligence (AI) and real-time data. The proposed method uses a stochastic structure including the point estimate method and grey wolf optimization (GWO) to provide a suitable scheduling program for a renewable based building. Moreover, a correction approach is developed to improve the search ability of the GWO. Different renewable sources of photovoltaics and wind turbine are considered for the power supply to the building. Considering the big size of the unit, two gas turbines are also incorporated to help emergency support of the building. The output power of the renewable energy sources are forecasted using the support vector machine (SVM) to have an accurate and reliable analysis. Considering the high uncertainty effects, point estimate method is a suitable method for handling the forecast errors. Two different scenarios are simulated to check the energy management problem in the normal and emergency cases in the building. The model is validated using a typical building test system. © 2022