This paper presents the design and development of an innovative multiagent system based on virtual organizations. The multiagent system manages information from wireless sensor networks for knowledge discovery and decision making in rural environments. The multiagent system has been built over the cloud computing paradigm to provide better flexibility and higher scalability for handling both small-and large-scale projects. The development of wireless sensor network technology has allowed for its extension and application to the rural environment, where the lives of the people interacting with the environment can be improved. The use of "smart" technologies can also improve the efficiency and effectiveness of rural systems. The proposed multiagent system allows us to analyse data collected by sensors for decision making in activities carried out in a rural setting, thus, guaranteeing the best performance in the ecosystem. Since water is a scarce natural resource that should not be wasted, a case study was conducted in an agricultural environment to test the proposed system's performance in optimizing the irrigation system in corn crops. The architecture collects information about the terrain and the climatic conditions through a wireless sensor network deployed in the crops. This way, the architecture can learn about the needs of the crop and make efficient irrigation decisions. The obtained results are very promising when compared to a traditional automatic irrigation system.