The scale of human accidents and the resultant damage has increased due to recent large-scale urban (building) fires, meaning there is a need to devise an effective strategy for urban disasters. In the event of a fire, it is difficult to evacuate in the early stages due to the loss of detection function, difficulty in securing visibility, and confusion over evacuation routes. Accordingly, for rapid evacuation and rescue, it is necessary to build a city-level fire safety service and digital system based on smart technology. In addition, both forest and building fires emit a large amount of carbon dioxide, which is the main cause of global warming. Therefore, we need to prepare both energy and fire management to achieve carbon neutrality by 2030. In this study, we developed an AI-based smart fire safety system for efficient urban integrated management using a city-based fire safety architecture. In addition, we designed a fire management infrastructure and an energy management system for buildings. The proposal was demonstrated by building a test bed in the A building, and the AR-based mobile/web application was tested for optimized evacuation management. Furthermore, AI-based fire detection and the optimal evacuation of occupants were implemented through deep learning-based fire information data analysis. As a result, this paper presents four points for safety and energy management, and we demonstrate that the optimization of occupant evacuation ability and energy saving can be achieved. We also analyze the efficiency of the data transfer rate to prevent data communication delays by using Virtual Edge Gateway (VEG) management. In the future, we expect that the appearance of future fire and energy management buildings through this research will produce more accurate data prediction technology and the development of cutting-edge smart technology in smart city infrastructures.