This study investigates the effects of heat generation and magnetic fields on natural convection in a wavy porous cavity filled with a hybrid nanofluid (Al₂O₃-Cu/water), using the hybrid finite volume method (FVM) and XGBoost model within the local thermal non-equilibrium (LTNE) framework. The cavity contains inner heaters with variable lengths, positions, and heat generation/absorption coefficients. The primary objective is to analyze the interplay of key parameters, including heat source length (\(B\)), position (\(D\)), solid volume fraction (\(\phi\)), porosity (\(\varepsilon\)), Hartmann number (\(Ha\)), Rayleigh number (\(Ra\)), and the heat generation/absorption coefficient (\(Q\)). The results provide insights into optimizing heat and mass transfer characteristics under varying conditions, with potential applications in thermal management systems. The mathematical model incorporates the governing equations for continuity, momentum, and energy for the fluid and solid phases. The LTNE approach accounts for separate temperature fields for the fluid and solid, enabling a detailed analysis of the thermal behavior. The numerical simulations were performed using dimensionless formulations, allowing the study of a wide range of physical and geometric parameters. The cavity geometry includes a wavy right wall maintained at a cold temperature (\({T}_{c}\)) and a flat left wall with localized heat sources (\({T}_{h}\)). The findings reveal the significant influence of \(B\), \(D\), \(\phi\), and \(Q\) on the flow structure and thermal distribution. An increase in \(B\) intensifies convective currents and enhances heat transfer efficiency, while the position of the heat source (\(D\)) modulates the distribution of buoyancy forces. The addition of nanoparticles (\(\phi\)) improves the effective thermal conductivity of the hybrid nanofluid, enhancing both fluid and solid phase heat transfer. Positive values of \(Q\) further amplify buoyancy-driven convection, resulting in higher Nusselt numbers (\(Nu\)). The impact of porosity (\(\varepsilon\)) and Rayleigh number (\(Ra\)) was also evaluated. Higher porosity values promote fluid permeability, facilitating stronger convective currents and more uniform temperature profiles. Similarly, increasing \(Ra\) shifts the dominant heat transfer mechanism from conduction to convection, enhancing thermal mixing and efficiency. The Hartmann number (\(Ha\)) was found to suppress convection due to magnetic damping effects, reducing heat transfer rates. However, this damping can be partially offset by the enhanced thermal conductivity from higher nanoparticle concentrations (\(\phi\)). AI-based models, specifically XGBoost, were employed to predict the Nusselt number for nanofluid and solid phases and the average heat transfer characteristics. The predictions align well with the numerical results, validating the model’s applicability for optimizing thermal systems. Overall, the study demonstrates that careful selection of parameters such as \(B\), \(D\), \(\phi\), \(\varepsilon\), and \(Q\), coupled with the use of hybrid nanofluids, can significantly improve the thermal performance of porous cavities under MHD conditions.