In this paper, an artificial intelligence enabled energy-saving strategy (AIESS) is proposed to achieve high energy efficiency of hydraulic systems with a speed and displacement variable pump (SDVP). The AIESS, which integrates extreme gradient boosting (XGBoost) and genetic algorithm (GA), can generate the optimum combination of motor speed and pump displacement of SDVP in real time under actual working conditions. The XGBoost-based power model is used to accurately predict the input power of the SDVP considering environmental factors, e.g., oil temperature, then followed by GA for optimization, in which the XGBoost-based power model is the objective function. A test rig with a 16t hydraulic press and a stamping process is applied to validate the effectiveness of the proposed strategy. Compared to four other algorithm models, the XGBoost-based power model has the highest accuracy. The optimum combination can be obtained quickly by GA. The results show that the AIESS can reduce energy consumption by 28.6% during pressure-maintaining operation and by 11.2% during one stamping cycle compared to the previously proposed segmented control energy-saving strategy. <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Note to Practitioners</i> —Energy-saving hydraulic system is a topic in the automation industry. The low energy efficiency of electro-hydraulic systems is mainly caused by poor flow rate matching. A speed and displacement variable pump (SDVP) is used to address this problem, but it is difficult to find the matched speed and displacement for the highest energy conversion efficiency of the SDVP due to the inaccuracy energy model and the challenge of coupling variables. This paper presents an energy-saving strategy integrated with machine learning and a genetic algorithm to handle this challenge. Relative variables of the machine learning model are picked through analysis of the mathematical energy model, and the usage of machine learning can fit the high-nonlinear energy model caused by uncertainties in both components and environmental factors. The trained model is then used as an objective function for a GA-based optimization process to generate the optimum motor speed and pump displacement combination. Considering the processing time of GA, this combination can be optimized before the operation for known working conditions. Finally, we have established a 16t hydraulic press to validate this energy-saving strategy and pre-optimized five combinations for a stamping process. The proposed strategy can reduce energy consumption by 11.2% compared with the previous strategy. This energy-saving strategy can also be applied to other automated hydraulic equipment, such as injection machines.