The simultaneous detection of dopamine (DA) and acetaminophen (AP) is crucial for diagnosing and treating related mental disorders. However, accurately determining DA and AP in biological samples remains challenging due to the interference from other biomolecules, such as ascorbic acid (AA), uric acid (UA), epinephrine (EP), etc. Here, we present a dual-template molecularly imprinted electrochemical sensor for the selective recognition of DA and AP. Reduced graphene(rGO)-gold nanoparticles(AuNPs) composite were utilized to enhance the effective area and increase the electron transfer rate of glassy carbon electrode(GCE), thus the electrochemical response signals were amplified. This sensor combined the advantages of nanocomposites and molecularly imprinted polymer (MIP) to achieve highly sensitive and selective detection of DA and AP. However, decreases in the current response of some analytes and variations in relationships of the peak current versus analyte concentration will occur due to adsorption competition on active sites in multianalyte mixtures, rendering the detection range constrained and traditional linear fitting methods inaccurate for predicting analyte concentrations. Therefore, a concentration prediction model based on XGBoost was developed for the sensor to achieve the reliable multi-component determination of DA and AP within the identical measurement range as individual detection. In this model, nine characteristic parameters were extracted from the differential pulse voltammetry (DPV) response curve and Bayesian optimization (BO) was adopted for automatic hyperparameter search, thereby the prediction errors were reduced and the generalization ability was improved. Experiments indicated that the MIP/AuNPs/rGO/GCE exhibited a wide detection range of 2–240 μM and 3–240 μM for DA and AP, with detection limits down to 0.26 μM and 0.33 μM, respectively. In addition, the intelligent MIP/AuNPs/rGO/GCE sensor based on BO-XGBoost model provides more accurate prediction results for untrained concentration combinations obtained from fetal bovine serum samples, indicating that the proposed detection scheme holds potential in future clinical diagnosis.