Moringa is a nutritious plant, which can also be considered a medicinal plant since its extracts are rich in flavonoids with an inhibitory effect against viruses. Optimization and an early warning of monitoring are critical for the extraction processes that result in high output with minimal costs and time. Numerous studies have been concerned with moringa leaves and seeds; however, they have not included machine learning in the solution process. Furthermore, early warning systems have still not been discussed in recent studies on streaming during moringa leaf extraction. In this study, we exploit the automatic relevance determination (ARD) with sailfish optimizer (SFO) to determine the optimal extraction time duration and solvent during moringa leaf extraction to attain a high yield of flavonoids compounds. The optimized ARD regression model with SFO resulted in an MSE of 0.000664, an RMSE of 0.025762, and an R-squared of 0.769697. The optimized model is then deployed as a web service that generates two outputs: the optimized time and solvent type. Additionally, we developed a mobile application for online monitoring and alerting. The nearest neighbors (k-NN) regressor is used in conjunction with statistical methods to forecast future values of a time series and identify anomalies to provide an early warning system.