Abstract Background Being one of the most widespread, pervasive, and troublesome illnesses in the world, depression causes dysfunction in various spheres of individual and social life. Regrettably, despite obtaining evidence-based antidepressant medication, up to 70% of people are going to continue to experience troublesome symptoms. Quetiapine, as one of the most commonly prescribed antipsychotic medication worldwide, has been reported as an effective augmentation strategy to antidepressants. The right quetiapine dose and personalized quetiapine treatment are frequently challenging for clinicians. This study aimed to identify important influencing variables for quetiapine dose by maximizing the use of data from real world, and develop a predictive model of quetiapine dose through machine learning techniques to support selections for treatment regimens. Methods The study comprised 308 depressed patients who were medicated with quetiapine and hospitalized in the First Hospital of Hebei Medical University, from November 1, 2019, to August 31, 2022. To identify the important variables influencing the dose of quetiapine, a univariate analysis was applied. The prediction abilities of nine machine learning models (XGBoost, LightGBM, RF, GBDT, SVM, LR, ANN, DT) were compared. Algorithm with the optimal model performance was chosen to develop the prediction model. Results Four predictors were selected from 38 variables by the univariate analysis (p