In the face of increasing global energy demand and volatile energy prices, many countries are searching for solutions to ensure their energy independence. One of the most popular solutions is to incorporate renewable energy sources in their energy systems. While there are many advantages to integrating renewable energy sources, it is important to note that their intermittent operation can present challenges. Energy storage and smart grid management systems are key solutions to overcome these challenges and ensure sustainable, reliable use of renewable energy sources. In this article, we present an intelligent electrical energy management system for hybrid energy systems. This management system is based on a multi-layer neural network that has undergone an architecture optimization phase to improve the accuracy of real-time energy management and simplify its implementation. The management model that was built demonstrated highly good performance across a range of test circumstances.