Authors - Khalid BOUALI, Abderrahim BAJIT, Hamza BENZZINE, Hicham ESSAMRI, Yasmine ACHOUR, Hassan EL FADIL, Rachid EL BOUAYADI Abstract - Modern agriculture faces significant challenges from climate change, necessitating innovative strategies for sustainability. Precision agriculture has emerged as a transformative solution, leveraging advances in Artificial Intelligence (AI), IoT, and Cloud computing to transition traditional farming into intelligent systems. However, reliance on centralized architectures introduces new challenges related to response time and operational costs. This paper presents an optimized and intelligent IoT system architecture leveraging Edge computing to enhance agricultural sustainability, with a focus on greenhouse IoT platforms. The proposed architecture integrates AIoT and incorporates an intelligent edge computing systems that locally manages sensor nodes, processes data, and predicts critical agricultural parameters, including Temperature T, Humidity H, Air Quality CO₂, Light Intensity UV, and Soil Moisture pH. The study evaluates the performance of three Supervised Machine Learning Regression models, Linear Regression, Random Forest, and Extreme Gradient Boosting (XGBoost), in predicting missing sensor data using dataset contains the key agriculture parameters. Additionally, a Long Short-Term Memory (LSTM) neural network is trained on the same dataset and evaluated at the edge to forecast future variations in microclimatic parameters. To optimize system efficiency, a novel functionality is implemented, operating in ON and OFF modes based on node states. This functionality enables the system to predict data, minimizing unnecessary data collection, conserving energy, and improving the longevity of Static Edge Nodes distributed across the Greenhouse. This work highlights the potential of AIoT-driven precision agriculture to provide robust, intelligent, and sustainable farming practices, effectively managing IoT system components and delivering reliable monitoring of critical agricultural parameters amidst climate-related challenges.