The establishment of near infrared (NIR) spectroscopy model mostly relies on chemometrics, and spectral analysis combined with artificial intelligence (AI) provides a new way of thinking for pharmaceutical quality inspection, new algorithms such as back propagation artificial neural networks (BP-ANN) and swarm intelligence optimization algorithms such as sparrow search algorithm (SSA) provide core technical support. In order to explore the application of AI in the pharmaceutical field, in this study, Angelica dahurica formula granules with a relatively complex system were selected as the research object. Quantitative analysis models were established by using partial least squares regression (PLSR) with a micro-NIR spectrometer, and BP-ANN modeling results were compared. For the best PLSR models of six characteristic components in the continuous counter-current extract of Angelica dahurica, R2v of imperatorin was lower than 0.90, and the RPD values of imperatorin, phellopterin, and isoimperatorin were even lower than 1. When the prediction model established by SSA-BP-ANN was used for quantitative analysis, R2v of six components were all higher than 0.92, and the RPD values all higher than 1.5, which proved that the BP-ANN method was better than PLSR. This study confirmed that in the continuous counter-current extraction progress of Angelica dahurica formula granules, the use of micro-NIR spectrometer combined with AI could realize the rapid prediction of the contents of six characteristic components. The comparison results provided a scientific reference for the process analysis and on-line monitoring in the production process of traditional Chinese medicine by micro-NIR spectrometer combined with AI.