Crop Recommendation and Agricultural Query Answering System Using Spatio-Temporal Graph Neural Networks and Hybrid Retrieval Augmentation

2026-06-08Machine Learning

Machine LearningArtificial Intelligence
AI summary

The authors created a system to help farmers by predicting the weather for the next 30 days in Nepal using two deep learning models, with one model called STGCN performing better. They use these weather forecasts along with soil information to suggest the best crops to plant in each location. They also built a chatbot that answers farmers’ questions by using farming documents. Their system is available as a mobile app and has been tested to be useful, especially in rural areas where farming advice is hard to get. This work shows how combining smart predictions and local data can give farmers helpful advice for growing crops.

Precision AgricultureTransformerGraph Neural NetworkSpatio-Temporal Graph Convolutional NetworkWeather ForecastingSoil PropertiesCrop RecommendationRetrieval-Augmented GenerationChatbotMobile Application
Authors
Prajwal Thapa, Yagya Raj Pandeya
Abstract
This paper presents a unified system designed to support precision agriculture by integrating advanced weather prediction, crop recommendation, and a question-answering tool for farmers. We propose two deep learning models -- a Transformer-based Graph Neural Network and a Spatio-Temporal Graph Convolutional Network (STGCN) -- to forecast weather conditions for the next 30 days using data from 1,359 locations in Nepal. The STGCN outperforms the Transformer-based model in accuracy (MSE ~0.011 vs. 0.013), effectively modeling both spatial and temporal dependencies in climate data. These predictions are combined with static soil properties such as pH, moisture, and organic content to generate localized crop recommendations through a scoring algorithm that matches each crop's optimal growing conditions. Additionally, we develop a Retrieval-Augmented Generation (RAG) chatbot that leverages domain-specific agricultural documents to answer farmers' questions in natural language. The entire system is deployed via a mobile application, offering real-time suggestions and conversational support. User feedback confirms the system's usability and relevance, especially in rural settings where personalized farming guidance is limited. Overall, our approach demonstrates how combining machine learning models with local agricultural data can empower farmers with actionable insights, promoting more informed decisions, better crop yields, and increased resilience to climate variability.