The optimal power flow for networked microgrids with different renewable energy sources (PV panels and wind turbines), storage systems, generators, and load is investigated in this study. A conventional method and an Artificial Intelligence method are applied to solve the OPF problem. The performance of MGs system with renewable energy integration was investigated in this study, with a focus on power flow studies. The power flow is calculated using the well-known Newton-Raphson method and the Neural Network method. The power flow calculation is used to assess grid performance parameters like voltage bus magnitude, angle, and real and reactive power flow in system transmission lines. under given load conditions. The standard test system used was a benchmark test system for Networked MGs with four MGs and 40 buses. The data for the entire system has been chosen as per the IEEE Standard 1547-2018. The results showed minimumlosses and higher efficiency when performing OPF using NN than the Newton-Raphson method. The efficiency of the power system for the networked MG is 99.3% using Neural Network and 97% using the Newton- Raphson method. The Neural Network method, which mimics how the human brain works based on AI technologies, gave the best results and better efficiency in both cases (Battery as Load/Battery as Source) than the conventional method.