## 2 Theoretical Background  
Agri-food chains, understood as complex networks that connect agricultural systems with final consumers through production, processing, storage, and distribution processes [20], are highly susceptible to events such as climate change, market readjustments, armed conflicts, ecological disasters, changes in consumption habits, and food policies [21]. A simplified view of the agri-food chain shows three main links: production (cultivation), processing (food production), and final consumption [22]. The first link in the chain is food production or cultivation, where multiple interrelated variables such as soil, climates, and plants must be analyzed and optimized. In this case, precision agriculture, or precision farming, allows for the monitoring, controlling, and treating of crops and land to reduce their spatial and temporal variability, facilitating appropriate treatments in time and place [23]. This concept gives rise to smart agriculture, which focuses on using information and communication technologies that increase production quality and quantity while improving the efficiency of human intervention [24]. This is achieved through the implementation of weather stations, precision irrigation, sensors (soil, water, light, humidity, and temperature), software, location systems (GPS and satellite), communication systems (Wi-Fi, Lora, Bluetooth, Zigbee, and LoraWan, among others), and robots (drones, among others) (see Figure 1). For the processing link, where raw materials obtained in production are taken and food processing processes are carried out, these transformation processes contemplate the use of equipment and control parameters such as temperature, time, pH, humidity, and pressure, among others. In this case, the Industrial IoT (IIoT) emerges, allowing the control of entire processing plants through interconnected sensors [26]. This approach, also known as industry 4.0, allows for the increase of the production of final goods through automation and predictive maintenance, as well as the optimization of the decision-making process through the management of information in real-time [27] (see Figure 1). Regarding the consumption link, where the products elaborated upon directly satisfy client needs, different studies focus on capturing perceptions and the recognition, recommendation, and monitoring of food. Therefore, the concept of Food Computing is a research approach focused on the consumer who supports his/her purchasing decisions based especially on social networks (Facebook, Twitter, Instagram, and YouTube Foursquare, among others), IoT, and web media [28], and the data obtained are analyzed  
Figure 1: Bidirectional model of data generation and use in agri-food chains. Elaborated upon by the authors based on [25]. through text-mining techniques and the analysis and processing of natural language or opinion mining, enabling the understanding of the habits, the perception of health that consumers have, as well as how recommendable certain foods are (see Figure 1). Finally, as a transversal element between the three links described above, there is the logistics and supply of food, which facilitates the flow of ingredients and finished products under hygiene, temperature, and storage conditions. Hence, integrating IoT, Radio-frequency identification (RFID), and Blockchain technologies allows for the monitoring of quality variables and the improvement of food tracking and its traceability [29; 30] (see Figure 1). The specialized literature integrates the different perspectives mentioned above from the concepts of Computer Science under the notion of Food Informatics, which, for this research proposal, will be understood as the collection, preparation, analysis, and intelligent use of data from agriculture, supply chains, food processing, and consumers for the extraction of knowledge and the development of intelligent analysis that allows for the optimization of agro-chains based on data analytics [25].