Microgrids are defined as an interconnection of several renewable energy sources in order to provide the load power demand at any time. Due to the intermittence of renewable energy sources, storage systems are necessary, and they are generally used as a backup system. Indeed, to manage the power flows along the entire microgrid, an energy management strategy (EMS) is necessary. This paper describes a microgrid energy management system, which is composed of solar panels and wind turbines as renewable sources, Li-ion batteries, electrical grids as backup sources, and AC/DC loads. The proposed EMS is based on the maximum extraction of energy from the renewable sources, by making them operate under Maximum Power Point Tracking (MPPT) mode; both of those MPPT algorithms are implemented with a multi-agent system (MAS). In addition, management of the stored energy is performed through the optimal control of battery charging and discharging using artificial neural network controllers (ANNCs). The main objective of this system is to maintain the power balance in the microgrid and to provide a configurable and a flexible control for the different scenarios of all kinds of variations. All the system’s components were modeled in MATLAB/Simulink, the MAS system was developed using Java Agent Development Framework (JADE), and Multi-Agent Control using Simulink with Jade extension (MACSIMJX) was used to insure the communication between Simulink and JADE.