This work investigates the heat transfer characteristics of natural convection in a water-based hybrid nanofluid flow inside a U-shaped cavity, with the objective of enhancing thermal efficiency in solar dish collectors. The artificial compressibility finite-difference method (AC-FDM) is employed for numerical analysis, ensuring the precise calculation of flow and heat fields. Hybrid nanoparticles Cu-Fe3O4 and MoS2-Fe3O4 are utilized to evaluate their impact on thermal efficiency, employing machine learning methodologies to determine optimal configurations and investigate parameter variations. Essential factors, including the Rayleigh number, Darcy number, thermal radiation parameter, heat source/sink parameter, and Hartmann number, are analyzed, indicating that elevated Rayleigh numbers enhance heat transfer by increasing the average Nusselt number, while the thermal radiation parameter further improves efficiency. Isotherms and streamlines depict flow and thermal patterns, exhibiting stratification and asymmetry as the Rayleigh number increases. The velocity and temperature patterns along the hollow centerline provide more information. The results underscore the promise of hybrid nanoparticles in enhancing technology such as solar collectors, heat exchangers, microvascular devices, and photothermal cancer treatment. The purpose of this research is to build a unique framework that integrates AC-FDM and machine learning in order to improve thermal control and system efficiency in engineering and biomedical applications.