This study investigated the steady two-phase flow of a nanofluid in a permeable duct with thermal radiation, a magnetic field, and external forces. The basic continuity and momentum equations were considered along with the Buongiorno model to formulate the governing mathematical model of the problem. Furthermore, the intelligent computational strength of artificial neural networks (ANNs) was utilized to construct the approximate solution for the problem. The unsupervised objective functions of the governing equations in terms of mean square error were optimized by hybridizing the global search ability of an arithmetic optimization algorithm (AOA) with the local search capability of an interior point algorithm (IPA). The proposed ANN-AOA-IPA technique was implemented to study the effect of variations in the thermophoretic parameter (Nt), Hartmann number (Ha), Brownian (Nb) and radiation (Rd) motion parameters, Eckert number (Ec), Reynolds number (Re) and Schmidt number (Sc) on the velocity profile, thermal profile, Nusselt number and skin friction coefficient of the nanofluid. The results obtained by the designed metaheuristic algorithm were compared with the numerical solutions obtained by the Runge–Kutta method of order 4 (RK-4) and machine learning algorithms based on a nonlinear autoregressive network with exogenous inputs (NARX) and backpropagated Levenberg–Marquardt algorithm. The mean percentage errors in approximate solutions obtained by ANN-AOA-IPA are around 10−6 to 10−7. The graphical analysis illustrates that the velocity, temperature, and concentration profiles of the nanofluid increase with an increase in the suction parameter, Eckert number and Schmidt number, respectively. Solutions and the results of performance indicators such as mean absolute deviation, Theil’s inequality coefficient and error in Nash–Sutcliffe efficiency further validate the proposed algorithm’s utility and efficiency.