This paper presents a framework to analyze the problem of real-time management of Smart Grids. For this purpose, the energy management is integrated with the power system through a telecommunication system. The use of Multiagent Systems (MAS) leads the proposed algorithm to find the best-integrated solution, taking into consideration the operating scenario and the system characteristics. With this framework it was possible to evaluate the design of the energy management and the impact of the algorithm developed in the MAS. In the same way, the data sent from the power system to be used for energy management have a direct impact on his behavior. The proposed framework is tested with the help of a microgrid, so the results may be replicated.