<p>In preconception counseling, there has been a lack of quantitative approaches to predict the outcome of an upcoming pregnancy, which would greatly benefit women and society. By applying state-of-the-art artificial intelligence algorithms to clinical and metabolome data from 481 women, we have, for the first time, proposed a pre-pregnancy classifier that predicts miscarriage with a high precision rate of 87%. Our embedded feature engineering revealed the critical impact of serum histidine level, further supported by its elevation in recurrent spontaneous miscarriage (RSM). Mechanistically, elevated histidine level, combined with compromised diamine oxidase (DAO) expression, led to a fatal accumulation of histamine at the maternal-fetal interface (157 specimens from 113 donors). Additionally, a high-histidine diet induced significant embryo loss in mice without causing malabsorption of other amino acids. This pilot study shows promise in predicting pregnancy outcomes prior to conception, opening an important window for early warning that is particularly meaningful given the global decline in birth rates.</p>