Microgrids offer an optimistic solution for delivering electricity to remote regions and incorporating renewable energy into existing power systems. However, the energy balance between generation and consumption remains a significant challenge in microgrid setups. This research presents an adaptive energy management approach for grid-interactive microgrids. The DC microgrid is established by combining solar PV with a battery-supercapacitor (SC) hybrid energy storage system (HESS). The proposed approach integrates the frequency separation strategy with a rule-based algorithm to ensure optimal power sharing among sources while maintaining the safe operation of storage units. Specifically, the battery meets steady-state energy demands, the SC addresses transient power requirements, and the grid support is tailored to system needs. The method employs the dq reference frame technique to control the grid inverter (VSC). The key merits include efficient power allocation, fast regulation of the DC link voltage irrespective of load or generation variations, seamless transition between scenarios, and introduction of a straightforward battery state of charge (SOC)-based coefficient for allocating power between the battery and the grid while enhancing the power quality within the grid. Moreover, safety measures prevent the SC from overcharging, the battery from high current, overcharging, and deep discharging, potentially extending their lifespan. Validation and implementation of the method are conducted using MATLAB/Simulink.