Abstract In this paper, the experiments of desalinating the NaCl aqueous solution were carried out using an air gap membrane distillation module with energy recovery. Response surface methodology (RSM) was applied to develop a regression model relating operating parameters with performance indicators of the AGMD system. Operating parameters including cold feed inlet temperature (T1), hot feed inlet temperature (T3) and feed-in flow rate (F) were considered and distillate flux (J) and gained output ratio (GOR) were selected as the performance indicators. The regression model developed by RSM was tested by analysis of variance (ANOVA). Based on the regression model, it was found that T3 has the highest positive effect on both J and GOR, and there was a trade-off between J and GOR when T1 and F varied. Non-dominated sorting genetic algorithm II (NSGA-II) was firstly used to maximized J and GOR simultaneously. Under the optimum condition, the maximum GOR and J could reach 8.78 and 5.07L/m2·h respectively.