AgroAdvisor: RAG-Powered Explainable AI for Soil Nutrient Profiling and Crop Yield Recommendations
Background: Determining the health of soil and predicting the output of agriculture are complicated processes owing to regional variation and complex nutrient interactions among soil properties. Methods: AgroAdvisor acts as a decision support system using predictive models, particle swarm optimization (PSO) and retrieval-augmented generation (RAG). Soil health parameters such as nitrogen (N), phosphorous (P), potassium (K), pH and moisture levels are analyzed through a hybrid regression model incorporating random forest and gradient boosting. PSO is used for hyperparameter optimization, which improves the accuracy of prediction compared to traditional methods. Result: Experimental testing on soil samples from South India demonstrated a decrease in mean absolute error ranging between 18% to 23% due to PSO optimization. The retrieval-augmented generation technique, based on scientific papers, ICAR/FAO guidelines and local soil management techniques, generated contextually relevant and internally consistent recommendations for fertilizer usage, crop rotation and soil management.