This paper presents the intricate architectural design and operational capabilities of the Autonomous multi-factor Energy Flow Controller (AmEFC) in managing energy flow within microgrids. Central to its function, the AmEFC Controller harmonizes software computations with hardware interfacing to guarantee optimal energy flow and system reliability. Notably, it factors in weather forecasting for predictive energy management and allows city-scale intercommunication between local AmEFC controllers for efficient energy surplus exchange. The framework is structured hierarchically, incorporating diverse energy sources and storage mechanisms, dynamic load management, supplemental energy, and advanced decision-making systems. A unique innovation lies in its adaptive response to surplus energy, directing it into gravitational potential energy via hydro pumps. The Simulink model of the on-grid AmEFC microgrid prototype is introduced, representing the integration of renewable energy sources, storage systems, and critical load distribution. Through scenario analysis in the Simulink model, the paper assesses the system’s reliability in consistently powering critical loads and its strategy in managing surplus energy. Conclusively, the AmEFC system emerges as a promising solution for future resilient, adaptable, and efficient microgrids, further empowered by its predictive and collaborative capabilities.