ABSTRACT
Advances in artificial intelligence and natural language processing are transforming decision-support systems in agriculture, enabling real-time interaction between humans and machines for smarter and more accessible crop management. This study presents the development and evaluation of an intelligent monitoring system for hydroponic cultivation, integrating a chatbot based on large language models (LLMs) and a retrieval-augmented generation (RAG) architecture. Designed to support smallholders, the system provides real-time technical assistance in natural language by integrating environmental sensor data, such as pH, temperature, and electrical conductivity (EC), with a semantic vector database indexed by four embedding models: text-embedding-ada-002, multilingual-v2, all-MiniLM-L6-v2, and Word2Vec. Twenty structured and unstructured agronomic questions were used to assess the system’s ability to generate relevant and factually accurate responses through ChatGPT and Gemini. Real-time data from lettuce cultivation trials were formatted in JSON, which were used to simulate decision scenarios. These included both historical queries (e.g., pH trends) and conceptual questions (e.g., ideal EC range). Results showed that the text-embedding-ada-002 model consistently achieved the highest semantic relevance (mean = 0.88) and factual faithfulness (mean = 0.72 with Gemini), outperforming the other embeddings. The multilingual-v2 showed moderate results, while the MiniLM and Word2Vec performed poorly in complex or context-dependent tasks. Gemini slightly outperformed ChatGPT in producing faithful responses. The proposed system is effective as a low-cost decision-support tool for hydroponics and can be scaled to other domains, such as irrigation and greenhouse management. This study highlights the potential of embedding enhanced LLMs and RAG architectures to democratize access to precision agriculture technologies.
Key words:
chatbot; hydroponic cultivation; retrieval-augmented generation; language models; precision agriculture
HIGHLIGHTS:
An intelligent chatbot uses LLM and RAG to monitor hydroponic cultivation, providing technical responses in natural language.
The smart system integrates environmental sensors and artificial intelligence to provide accurate agronomic recommendations.
When combined with Gemini, the text-embedding-ada-002 model yielded responses with higher faithfulness and relevance.
RESUMO
Avanços em inteligência artificial e processamento de linguagem natural estão transformando os sistemas de apoio à decisão na agricultura, permitindo a interação em tempo real entre humanos e máquinas para um manejo de culturas mais inteligente e acessível. Este estudo apresenta o desenvolvimento e a avaliação de um sistema inteligente de monitoramento para cultivo hidropônico, integrando um chatbot baseado em grandes modelos de linguagem (LLMs) e uma arquitetura de geração aumentada por recuperação (RAG). Projetado para apoiar agricultores familiares, o sistema fornece assistência técnica em tempo real em linguagem natural por meio da integração de dados de sensores ambientais, como pH, temperatura e condutividade elétrica (CE), com um banco de dados vetorial semântico indexado por quatro modelos de embeddings: text-embedding-ada-002, multilingual-v2, all-MiniLM-L6-v2 e Word2Vec. Vinte perguntas agronômicas estruturadas e não estruturadas foram utilizadas para avaliar a capacidade do sistema em gerar respostas relevantes e factualmente precisas por meio do ChatGPT e do Gemini. Dados em tempo real de ensaios de cultivo de alface, formatados em JSON, foram usados para simular cenários de decisão. Esses dados incluíam tanto questões históricas (por exemplo, tendências de pH) quanto questões conceituais (por exemplo, faixa ideal de CE). Os resultados indicaram que o modelo text-embedding-ada-002 apresentou maior relevância semântica (média = 0,88) e fidelidade factual (média = 0,72 com o Gemini), superando os demais embeddings. O multilingual-v2 mostrou desempenho moderado, enquanto MiniLM e Word2Vec foram inferiores em tarefas complexas. O Gemini teve um desempenho ligeiramente melhor que o ChatGPT na produção de respostas fiéis. O sistema proposto demonstrou ser uma ferramenta de apoio à decisão eficaz e de baixo custo e escalável para outros fins, como irrigação e manejo de estufas, evidenciando o potencial de LLMs e arquiteturas RAG na democratização da agricultura.
Palavras-chave:
chatbot; cultivo hidropônico; geração aumentada por recuperação; modelos de linguagem; agricultura de precisão
INTRODUCTION
Precision agriculture encompasses a set of practices that leverage information and communication technologies to optimize input usage, enhance yield, and reduce losses throughout the production process. When applied to hydroponics (soil-free cultivation) it requires continuous monitoring of key parameters both of the internal conditions of the growing environment (air temperature and relative air humidity) and of the nutrient solution (pH, electrical conductivity (EC), temperature, and dissolved oxygen), since even minor deviations can significantly affect plant growth and yield (Miranda et al., 2025).
In recent years, advances in artificial intelligence (AI) have enabled the incorporation of language models and recommendation systems into agriculture, expanding the potential for real-time technical support. Among these innovations, specialized chatbots have emerged as promising tools. By integrating crop data with trained language models, they offer contextualized responses, automated alerts, and continuous agronomic assistance (Kavinda et al., 2023). This technology proves particularly useful in systems monitored by Internet of Things (IoT) devices, such as controlled-environment hydroponic systems.
The relevance of chatbots lies in their ability to interact with users through natural language, making advanced technology accessible even to smallholders. Although modern chatbots are embedded within sophisticated intelligent systems, their conceptual foundation dates back to the 1950s with the Turing Test (Turing, 1950), a milestone in AI history that inspired the development of contemporary conversational agents (Adamopoulou & Moussiades, 2020).
In the face of persistent challenges in agricultural extension services, particularly those related to information access in rural areas, conversational agents (bots) have emerged as promising tools to support farmers with timely, context-aware knowledge. In India, traditional initiatives such as the Kisan Call Center (KCC), though pioneering in bridging agriculture and information technology, have encountered limitations, including network congestion and limited support from call center operators. Leveraging the growing digital connectivity of rural communities through platforms like WhatsApp, Darapaneni et al. (2022) proposed Farmer-Bot, an interactive chatbot trained on historical KCC data to semantically match and respond to farmers’ queries using natural language processing.
Recent large language models (LLMs), such as GPT-3, GPT-4 (OpenAI), and Gemini (Google), built on the Transformer architecture (Vaswani et al., 2023; Raiaan et al., 2024), have revolutionized natural language processing. These models offer advanced contextual comprehension, coherent response generation, and adaptability to specific domains (Hariri, 2023). However, standalone LLMs still present limitations, including hallucinations and difficulty retaining long-term context in extended interactions.
To address these shortcomings, the Retrieval-Augmented Generation (RAG) architecture was developed (Luo et al., 2022; Zhao et al., 2024). RAG integrates a vector-based retrieval system into the LLM pipeline (Lewis et al., 2021), enabling the model to access relevant information from specialized corpora at inference time, thereby improving factual accuracy without retraining.
The effectiveness of RAG systems heavily relies on the quality of embeddings used for document indexing. Early models such as Word2Vec were limited to static word co-occurrences (Mikolov et al., 2013), whereas contextual embeddings like BERT and Sentence-BERT enhanced semantic retrieval (Reimers & Gurevych, 2019). More recently, OpenAI’s text-embedding-ada-002 has been optimized for high-dimensional semantic similarity tasks, outperforming earlier models across various benchmarks (Souza & Souza Filho, 2023). In this context, the present study proposes the development and evaluation of an intelligent chatbot system for monitoring and technical support in indoor hydroponic cultivation, with a focus on lettuce production.
MATERIAL AND METHODS
The project was structured into sequential and interdependent stages, ranging from data collection and processing to integration with AI technologies, culminating in the implementation of an interactive chatbot capable of delivering technical information through natural language dialogue. This approach aimed to build an efficient system to support hydroponic farmers in decision-making and crop optimization, as illustrated in Figure 1.
Data collection formed the foundation for accurate monitoring of cultivation conditions. The environmental data were obtained through a controlled hydroponic experiment conducted at the Federal University of Technology - Paraná (UTFPR), Santa Helena campus, in a thermally insulated shipping container measuring 12 m (L) × 2.39 m (W) × 2.90 m (H) equipped with a nutrient film technique (NFT) system for lettuce (Lactuca sativa L.) cultivation (Miranda et al., 2025). The experiment lasted 21 days, covering the entire vegetative cycle from seedling establishment to harvest. Indoor monitoring was carried out using an array of digital sensors integrated into the control unit: DHT11 (air temperature and relative air humidity), MG811 (CO₂ concentration), PH-4502C (pH of irrigation water), TDS sensor (electrical conductivity of the nutrient solution), and DS18B20 (water temperature). For external ambient conditions, DHT11 sensors were employed to measure air temperature and relative air humidity, complemented by the BMP180 sensor for atmospheric pressure monitoring. Data were collected every 10 min and transmitted to a Raspberry Pi 4 microcontroller, which performed initial preprocessing and stored the data in a PostgreSQL database. To analyze the environmental monitoring data, descriptive statistics, including the mean, minimum, and maximum values, were calculated for each monitored variable, such as pH, EC, and nutrient solution temperature. The continuous time series collected throughout the cultivation cycle enabled a detailed assessment of the variation patterns of these parameters. All statistical processing was conducted in the Python environment using the Pandas library, applying the min, max, and mean functions to compute the respective metrics. This workflow ensured data consistency, reproducibility, and seamless integration of the calculated averages into the intelligent monitoring system for real-time query and decision-support operations.
The hydroponic solution was managed according to Furlani’s standard formulation, maintaining a pH of 6.0-6.2 and an EC of 1.6-1.9 dS m⁻1. Periodic corrections were made through nutrient replacement and aeration adjustments to ensure stable conditions throughout the cultivation period. This methodological approach ensured that all parameters monitored aligned with the conceptual framework described in the Introduction, emphasizing precision, reproducibility, and real-time integration with the intelligent monitoring system.
The data were stored in a PostgreSQL database, which also included scientific articles and technical documents related to hydroponic cultivation. This knowledge base was made accessible to the chatbot to support users with accurate responses to agronomic queries.
To enhance methodological transparency, the database was expanded to include scientific and technical documents selected through structured search criteria. The literature was retrieved from Scopus, IEEE Xplore, and arXiv databases using the following descriptors: “hydroponics”, “NFT system”, “pH control”, “EC monitoring”, “LLM”, “RAG”, and “precision agriculture”. Publications issued between 2015 and 2024, in English or Portuguese, were considered eligible when they presented quantitative values of environmental or nutritional parameters applicable to hydroponic systems. These inclusion criteria ensured consistency, reproducibility, and relevance of the knowledge base integrated into the intelligent monitoring system.
Data retrieved from the database were converted to .ods documents and subsequently cleaned and standardized for semantic indexing and LLM usage. This process was executed using Python, with libraries such as Pandas and NumPy enabling advanced data manipulation.
Initial preprocessing involved removing incomplete or inconsistent entries to ensure data integrity. Parsing procedures were applied to convert documents into a uniform structure and export them in JSON format, a standard compatible with AI applications. The structured format facilitated efficient information retrieval and enhanced the quality of chatbot responses.
After collection, the data were cleaned and standardized, with blank entries removed, values rounded to two decimal places, and other adjustments made to ensure consistency. The cleaned data were then converted from .ods to JSON, a widely used format for AI applications. This conversion facilitated semantic analysis by LLMs (Figure 2). The structured JSON format allowed each cultivation record to be represented as an independent object, enhancing tokenization, semantic retrieval, and vector indexing.
To improve LLM efficiency, the main JSON file was segmented into two 12-hour blocks (8 a.m. to 8 p.m. and 8 p.m. to 8 a.m.). This segmentation improved real-time response generation.
Tests were conducted with ChatGPT and Gemini using structured data indexed in the vector database. Prompts were carefully engineered to provide scope clarity and to constrain responses. The LLM was instructed to act as a hydroponic lettuce cultivation expert, responding to queries about temperature, relative air humidity, oxygenation, pH, EC, and CO₂ levels.
The prompt included:
-
1. Scope delimitation: respond only within the indexed data and relevant hydroponic topics;
-
2. Style guidelines: use clear, pedagogical language in the user’s language;
-
3. Reference inclusion: cite metadata where applicable;
-
4. Reporting instructions: provide summaries, averages, min/max values by date.
Agronomic reference values: e.g., pH 6.0-6.2, EC 1.6-1.9 dS m-1, solution temperature around 20 °C. This methodology significantly improved LLM response quality. The Qdrant library was used to build a vector database containing embeddings of JSON and PDF data, with LangChain converting the documents into retrievable objects using timestamps. Each vector was indexed with associated metadata. Tokenization was adapted for each embedding to preserve semantic coherence. The function load_documents_to_qdrant unified all sources for similarity-based retrieval.
To ensure the chatbot could provide accurate responses, scientific papers, technical manuals, and guidelines on hydroponic systems were integrated into the knowledge base. Figure 3 summarizes the steps from data extraction and standardization to conversion and indexing within the vector database used for semantic retrieval.
Four embedding models with distinct characteristics were employed to represent the semantic structure of the documents, allowing comparative analysis of performance in RAG-based retrieval:
-
1. text-embedding-ada-002: developed by OpenAI, offering 1536-dimensional vectors optimized for semantic similarity and information retrieval;
-
2. Word2Vec: a classical model based on word co-occurrence using CBOW and Skip-Gram architectures;
-
3. all-MiniLM-L6-v2: a compact six-layer SBERT-based model suitable for resource-constrained environments;
-
4. paraphrase-multilingual-MiniLM-L12-v2: a 12-layer multilingual BERT-based model capable of handling over 50 languages, producing 384-dimensional embeddings.
Model selection was based on architectural diversity, documented performance, and practical applicability in RAG systems. The text-embedding-ada-002 model was chosen for its state-of-the-art accuracy, while Word2Vec was included as a historical benchmark. The MiniLM models were selected for their balance between efficiency and multilingual support.
Each embedding was used to index documents in the vector database, feeding the context retrieval stage of the RAG pipeline. Embedding quality directly influenced the precision of LLM-generated responses.
Integration with an LLM constitutes the core of chatbot intelligence, enabling natural and accurate interactions. To support personalized recommendations, the LLM was enriched with:
-
1. Real-time hydroponic cultivation data: including parameters like pH, temperature, relative air humidity, and EC;
-
2. Technical documentation: scientific literature, manuals, and practical guides;
-
3. User interaction history: allowing contextual and adaptive responses.
An embedding-based approach facilitated vector storage of structured data. The integration process followed this workflow:
-
1. Data preprocessing: standardization and format conversion;
-
2. Vector indexing and storage: semantic embedding generation;
-
3. Optimized querying: LLM queries the vector store to retrieve context and generate tailored responses.
This method minimized ambiguity and ensured reliable, context-specific guidance for growers. The following large language models (LLMs) were evaluated:
ChatGPT:
-
1. A large-scale language model developed by OpenAI, based on the GPT-3 and GPT-4 architectures;
-
2. It is specifically designed for natural language interactions, delivering contextual, coherent, and dynamic responses.
Gemini AI:
-
1. An advanced language model developed by Google, which integrates modern machine learning techniques to enhance text comprehension and generation;
-
2. It is designed to leverage multimodal data and provides improved reasoning and synthesis capabilities, aiming to combine complex information to generate more accurate responses.
Figure 4 illustrates the complete interaction process between the grower and the chatbot, highlighting the query submission, context retrieval, and response generation stages based on data stored in the vector database.
The RAG-based architecture was adopted for its ability to overcome common LLM limitations, such as context loss and hallucination. By integrating a semantic vector database, the system could retrieve relevant data segments from historical and technical sources, enriching the LLM prompts with precise context.
This architecture also allows continuous knowledge base updates without retraining the model, a crucial feature in hydroponics, where environmental data evolves constantly. Its modular design supports system scalability and maintenance, providing advantages over traditional rule-based NLP systems. The chatbot serves as the system’s central interface, providing an intuitive, efficient platform for monitoring and agronomic support.
One of its core functions is intelligent monitoring: it continuously analyzes sensor data from the hydroponic system. Upon detecting deviations in parameters such as pH or temperature, the chatbot generates automated alerts, identifies production issues, and suggests corrective actions via a messaging application. The monitoring workflow includes:
-
1. Continuous data collection: real-time acquisition via environmental sensors;
-
2. Processing and analysis: continuous detection of anomalies;
-
3. Recommendation generation: alert issuance and proposed corrective actions.
This functionality minimizes risks and losses, enabling rapid decision-making and ensuring optimal conditions for plant development.
RESULTS AND DISCUSSION
Data stored in the database were processed via a Python-based Application Programming Interface (API) designed to format the information for interpretation by LLMs. Currently, the database runs locally (offline mode), and the input data are stored in .ods format. Table 1 presents a sample of collected measurements.
Additionally, the evaluation of the proposed system focused primarily on the consistency, accuracy, and contextual relevance of the responses generated by large language models (LLMs), rather than on inferential statistical outcomes typically derived from agronomic field trials. This analytical perspective aligns with the study’s technological validation framework, which uses performance metrics, such as semantic relevance and factual accuracy, to assess the chatbot’s ability to interpret and respond to agronomic queries. By emphasizing the quality and reliability of AI-generated outputs, the approach ensures methodological consistency. It aligns with current AI-driven validation standards applied to intelligent decision-support systems in agriculture.
Ten structured questions were asked: SQ1. “What was the highest external temperature recorded on December 12, 2024?”; SQ2. “Could you tell me the average pH value on December 11, 2024?”; SQ3. “What was the lowest CO₂ value detected on December 11, 2024?”; SQ4. “What was the average electrical conductivity (EC) recorded on December 10, 2024?”; SQ5. “Which day had the highest internal temperature between December 9 and 12, 2024?”; SQ6. “On which day was the highest CO₂ value recorded on December 10, 2024?”; SQ7. “Was there significant variation in pH between December 9 and 12, 2024?”; SQ8. “What was the highest EC value recorded during these four days?”; SQ9. “What was the lowest external temperature recorded between December 9 and 12, 2024?”; SQ10. “What was the internal temperature at 12:28 p.m. on December 9, 2024?”.
The LLMs demonstrated strong ability to understand the content of environmental records, providing responses consistent with the collected data. Figures 5 and 6 illustrate examples of responses generated for different queries.
Example of an LLM-generated response on pH and electrical conductivity values of the nutrient solution
These tests confirmed that LLMs effectively interpret environmental data and generate relevant technical insights, including alerts for pH and EC values outside the optimal range, thereby enabling precise and timely corrective actions in crop management. To validate the quality of LLM responses of ChatGPT and Gemini under each scenario, the following evaluation metrics were used (Gao et al., 2024):
-
1. Response relevance: semantic and factual alignment of the response with the query;
-
2. Context precision: the proportion of correctly retrieved relevant segments;
-
3. Context recall: the completeness in retrieving relevant context;
-
4. Faithfulness: qualitative metric for detecting hallucinations (information not present in the context).
These metrics evaluated not only the quality of responses but also the effectiveness of the RAG system’s context retrieval, supporting a comparative analysis of embedding and LLM models. To assess the impact of different embeddings on RAG system performance with LLMs, tests were conducted using ChatGPT and the same set of questions for four embeddings.
For both ChatGPT and Gemini with structured questions, the text-embedding-ada-002 model consistently yielded the highest relevance scores across nearly all questions, with values close to 1.00 in SQ1, SQ2, SQ3, SQ5, SQ6, SQ9, and SQ10 (Table 2). Notably, both models failed to produce relevant answers for SQ4, SQ7, and SQ8 using this embedding, suggesting potential limitations in the semantic matching or in the training data for these specific prompts.
The multilingual-v2 embedding demonstrated moderate relevance, with good performance for SQ1, SQ3, SQ5, and SQ9, but failed to generate relevant outputs for the remaining questions, especially in Gemini, where most scores were zero. This indicates that while this embedding may be effective for certain prompts, its coverage and consistency are limited.
In contrast, all-MiniLM-L6-v2 showed relevance only in a few instances (e.g., SQ1, SQ2, and SQ9), with no consistent pattern of high performance. The Word2Vec embedding performed poorly across all questions and models, with a complete absence of relevant responses (all scores = 0), confirming its inadequacy for this type of semantic task in both ChatGPT and Gemini. Conversely, Word2Vec failed to provide any relevant outputs, a limitation consistent with previous studies highlighting its inadequacy for complex semantic tasks (Mikolov et al., 2013; Mahajan et al., 2024).
To further support these findings, a statistical analysis was conducted to calculate the mean and standard deviation of the relevance scores for each model-embedding combination. The results revealed that text-embedding-ada-002 achieved the highest mean score (0.68) for both ChatGPT and Gemini, with a standard deviation of 0.47. This demonstrates not only its superior performance but also its relative consistency. Multilingual-v2 exhibited intermediate mean scores (0.39) with the highest variability (standard deviation = 0.51), while all-MiniLM-L6-v2 had a lower mean (0.29) and a similar level of dispersion (0.47). As expected, Word2Vec yielded a mean and standard deviation of 0.00, reflecting its complete inability to support relevant response generation in this context.
Overall, text-embedding-ada-002 was the most robust and reliable embedding across both LLMs, providing superior semantic grounding for generating contextually appropriate responses. This confirms the importance of embedding selection. Modern, contextual embeddings like text-embedding-ada-002 enable more accurate information retrieval, improving LLM response quality. These findings highlight its suitability for applications in intelligent agricultural advisory systems, where interpretability and technical precision are critical.
It is worth noting that although the context precision and context recall metrics were also evaluated, their values were mostly binary (0 or 1) because the questions were direct (e.g., numerical values of pH, EC, or temperature), and all embeddings achieved a score of 1. Thus, the relevance metric was more sensitive to nuances in response quality, particularly in detecting hallucinations.
A second round of testing was conducted using more technical, conceptual questions not directly tied to the structured cultivation data. These required reasoning about best practices and general agronomic knowledge in the context of technical questions: UQ1. “What is the ideal pH value for lettuce cultivation in a hydroponic NFT system?”; UQ2. “What is the recommended electrical conductivity (EC) for lettuce cultivation in controlled environments?”; UQ3. “What is the most productive irrigation interval when using an EC of 1.6 dS m-1 and pH 6.1?”; UQ4. “What was the maximum yield (in g per plant) achieved with pH 6.2 and EC 1.9 dS m-1?”; UQ5. “What are the maximum and minimum photoperiod values tested for baby leaf lettuce?”; UQ6. “What are the main macronutrients in the nutrient solution recommended by Furlani?”; UQ7. “What is the recommended plant density per square meter in indoor vertical farming systems?”; UQ8. “What is the optimal light spectrum for enhancing photosynthesis in indoor cultivation?”; UQ9. “From how many hours of daily light exposure does lettuce yield begin to decline?”; UQ10. “In indoor systems, what is the effect of EC variation between 1.3 and 2.2 dS m-1 on lettuce yield?”.
Both ChatGPT and Gemini, with unstructured technical questions (UQ1-UQ10), when combined with text-embedding-ada-002, achieved the highest performance, with a mean relevance score of 0.88 and a standard deviation of 0.31, indicating strong and consistent semantic understanding of unstructured technical content (Table 3). This confirms the robustness of this embedding across LLMs.
Relevance scores for unstructured technical unstructured questions (UQ), ChatGPT and Gemini, by embedding
The multilingual-v2 embedding achieved moderate average scores (0.77) across both LLMs but showed greater variability (standard deviation = 0.41), suggesting it performs well in some cases but lacks overall consistency (Table 3). The all-MiniLM-L6-v2 embedding showed limited performance (mean = 0.57) and higher variability (0.49), indicating it may be less reliable for interpreting nuanced, unstructured inputs (Table 3).
The Word2Vec embedding again underperformed, with the lowest average score (0.47) and the highest variability (0.50) (Table 3). While it produced some relevant outputs for a few questions, especially UQ1-UQ3, it failed to generate appropriate responses for more complex or context-specific queries (e.g., UQ4, UQ6-UQ9), reinforcing its limitations for LLM applications in real-world agricultural advisory contexts.
These findings reinforce that text-embedding-ada-002 remains the most effective and stable embedding model for handling complex and unstructured technical questions in both ChatGPT and Gemini. Its consistent performance makes it particularly suitable for intelligent virtual assistants and decision support systems in precision agriculture.
The all-MiniLM-L6-v2 performed well on simpler questions but showed limitations on more complex queries, aligning with the literature on smaller transformer models’ reduced effectiveness in intricate semantic tasks (Colangelo et al., 2025). Word2Vec consistently underperformed, highlighting its inherent limitations in tasks requiring contextual understanding (Mikolov et al., 2013).
For ChatGPT with unstructured technical questions (UQ1-UQ10), the multilingual-v2 embedding achieved the highest mean score (0.69 ± 0.40), indicating a relatively strong ability to generate factually correct answers (Table 4). Text-embedding-ada-002 and all-MiniLM-L6-v2 had similar averages (0.46 and 0.44, respectively), indicating moderate but less consistent performance. Word2Vec performed the worst (0.38), with significant variation across questions.
Faithfulness scores for unstructured technical questions (UQ) answered by ChatGPT and Gemini, by embedding model
For Gemini, the best performance was observed with text-embedding-ada-002 (0.72 ± 0.42), highlighting its robustness and reliability in producing factually accurate outputs. All-MiniLM-L6-v2 (0.60) and multilingual-v2 (0.58) also demonstrated reasonable faithfulness, though with higher variability (standard deviation ~0.42-0.47). Similar to ChatGPT, Word2Vec remained the least effective embedding (0.44).
An important observation is that Gemini generally achieved higher faithfulness scores than ChatGPT, particularly with text-embedding-ada-002. This suggests that pairing Gemini with this embedding might improve factual reliability in unstructured technical queries.
Overall, these results emphasize the critical role of embedding selection in ensuring factual accuracy. Text-embedding-ada-002, although not always the most relevant (Table 3), appears to offer a strong balance of faithfulness and semantic grounding, making it the most reliable choice for both LLMs in complex decision-support systems.
These tests demonstrate the importance of evaluating both the form (relevance) and the substance (faithfulness) of LLM-generated responses, especially in critical domains such as precision agriculture, where accuracy is vital (Gao et al., 2024).
Among the evaluated embeddings, text-embedding-ada-002 consistently achieved the highest scores in both structured and conceptual tasks. This supports the findings of Reimers & Gurevych (2019; 2020) that transformer-based embeddings outperform traditional models such as Word2Vec (Mikolov et al., 2013) in semantic understanding tasks. The superior performance is attributed to several factors: (i) high vector dimensionality (1,536 dimensions), which captures finer-grained semantic distinctions (Reimers & Gurevych, 2019; Mahajan et al., 2024); (ii) contrastive learning (as in Sentence-BERT), which improves representation quality; (iii) subword tokenization (Sennrich et al., 2016), which is critical for handling rare, domain-specific, or compound terms in agricultural contexts; and (iv) long-context processing capabilities (Radford et al., 2019). Word2Vec’s modest performance aligns with known limitations-static, context-independent vectors and lack of sentence-level semantic modeling (Mikolov et al., 2013; Mahajan et al., 2024).
Across all evaluated dimensions, semantic relevance and factual faithfulness, text-embedding-ada-002 proved to be the most robust and balanced embedding for both LLMs. Gemini consistently achieved slightly higher faithfulness scores, whereas ChatGPT often led in relevance depending on the embedding. These outcomes suggest that optimized pairings of LLMs and embeddings can significantly enhance the quality and reliability of AI-driven responses in domain-specific applications.
Overall, the findings validate the methodological strategy of embedding-based evaluation in natural language understanding tasks and provide empirical support for embedding selection in the deployment of conversational AI tools for agriculture. The empirical evidence that transformer-based embeddings, such as text-embedding-ada-002, are effective in RAG architectures for highly specialized domains like precision agriculture. It extends prior NLP findings (Radford et al., 2019; Reimers & Gurevych, 2019) and confirms the importance of strategic embedding choices for system robustness and reliability.
From a practical standpoint, the proposed intelligent monitoring system demonstrates significant potential for real-world application in hydroponic production, particularly among smallholders and educational or experimental facilities. The design prioritizes low-cost and open-source technologies, enabling producers with limited financial or technical resources to adopt precision management practices. All hardware components, including the Raspberry Pi 4 microcontroller and sensors (DHT11, MG811, PH-4502C, TDS, DS18B20, and BMP180), are commercially available and easily integrated via standard communication protocols (I2C, UART, and analog interfaces). This modular, scalable configuration allows users to expand or adapt the system to different hydroponic setups, from NFT (Nutrient Film Technique) to deep-water culture or vertical farming systems, without extensive reconfiguration.
The software architecture, developed in Python, integrates real-time sensor data with a retrieval-augmented generation (RAG) framework connected to a semantic vector database. This design ensures contextual responses by combining live environmental data with relevant scientific and technical information. Because the computational demands are modest, the platform can operate both locally (edge computing) and in the cloud, offering flexibility across rural and urban contexts.
The chatbot interface represents one of the most impactful features for democratizing access to agronomic knowledge. By interacting through natural language on smartphones, tablets, or desktop computers, hydroponic growers can receive context-aware guidance, troubleshooting assistance, and decision-support recommendations without prior technical expertise. This conversational approach reduces reliance on specialized consultants and mitigates the knowledge gaps often observed in small-scale production systems.
In addition to technical efficiency, the system supports the principles of social inclusion and sustainable innovation, aligning with global agendas such as the UN Sustainable Development Goals (SDGs 2, 9, and 12). Its capacity to integrate environmental monitoring, AI-based reasoning, and multilingual interaction makes it suitable not only for commercial hydroponics but also for educational training, urban agriculture initiatives, and digital extension programs. Future improvements will include mobile app integration, voice-based interfaces, and expanded IoT networks for remote management. These enhancements aim to strengthen the system’s scalability and accessibility, fostering a new paradigm of intelligent, participatory, and inclusive precision agriculture.
CONCLUSIONS
-
1. The study validated the integration of large language models (LLMs) with a retrieval-augmented generation (RAG) architecture as an effective and scalable approach for intelligent decision support in hydroponic cultivation.
-
2. Among the evaluated embeddings, text-embedding-ada-002 demonstrated superior semantic relevance and factual accuracy, outperforming multilingual-v2, MiniLM-L6-v2, and Word2Vec in both structured and unstructured tasks.
-
3. The proposed system successfully combined real-time sensor monitoring (pH, electrical conductivity, temperature, and CO₂) with natural language interaction, enabling accurate and context-aware agronomic recommendations.
-
4. The results confirmed the technical feasibility and robustness of the system, highlighting its ability to generate consistent and reproducible outputs across different data types and scenarios.
-
5. The hardware configuration (Raspberry Pi 4 and low-cost open-source sensors) and software implementation (Python and PostgreSQL) make the platform accessible to smallholders, educational environments, and research applications, promoting inclusiveness and digital transformation in agriculture.
-
6. Modern embeddings, especially text-embedding-ada-002, proved essential for ensuring linguistic coherence and factual reliability in AI-driven agricultural systems.
-
7. The developed framework provides a foundation for future applications, including greenhouse and irrigation management, voice-based chatbot interfaces, and sustainable data-driven agriculture through AI-enhanced decision support.
1
Financing statement:
Data availability statement:
The authors declare that there are no data underlying the text.
LITERATURE CITED
-
Adamopoulou, E.; Moussiades, L. An overview of chatbot technology. In: IFIP International Conference on Artificial Intelligence Applications and Innovations. Cham: Springer, 2020. p.373-383. https://doi.org/10.1007/978-3-030-49186-4_31
» https://doi.org/10.1007/978-3-030-49186-4_31 -
Colangelo, M. T.; Meleti, M.; Guizzardi, S.; Calciolari, E.; Galli, C. A comparative analysis of sentence transformer models for automated journal recommendation using PubMed metadata. Big Data and Cognitive Computing, v.9, 67, 2025. https://doi.org/10.3390/bdcc9030067
» https://doi.org/10.3390/bdcc9030067 -
Darapaneni, N.; Tiwari, R.; Paduri, A. R.; Saurav, S.; Chaoji, R.; Sohil. Farmer-Bot: an interactive bot for farmers. arXiv, arXiv:2204.07032, 2022. https://doi.org/10.48550/arXiv.2204.07032
» https://doi.org/10.48550/arXiv.2204.07032 -
Gao, Y.; Xiong, Y.; Gao, X.; Jia, K.; Pan, J.; Bi, Y.; Dai, Y.; Sun, J.; Wang, M.; Wang, H. Retrieval-augmented generation for large language models: a survey. arXiv, arXiv:2312.10997, 2024. https://doi.org/10.48550/arXiv.2312.10997
» https://doi.org/10.48550/arXiv.2312.10997 -
Hariri, W. OpenAI. GPT-4 technical report. arXiv, arXiv:2304.02017, 2023. https://doi.org/10.48550/arXiv.2304.02017
» https://doi.org/10.48550/arXiv.2304.02017 -
Kavinda, G. H. M.; Dissanayake, D. D. D.; Nanayakkara, K. A. K. K.; Swrnakantha, N. H. P. R. S.; Liyanagolla, M. N. V. K.; Kumari, P. K. S. Musa Base - Mobile application for banana farmers to minimize the challenges in banana production during the pre-harvest and post-harvest period. In: International Conference on Innovative Computing, Intelligent Communication and Smart Electrical Systems (ICSES), Chennai, 2023. p.1-7. https://doi.org/10.1109/ICSES60034.2023.10465553
» https://doi.org/10.1109/ICSES60034.2023.10465553 -
Lewis, P.; Perez, E.; Piktus, A.; Petroni, F.; Karpukhin, V.; Goyal, N.; Küttler, H.; Lewis, M.; Yih, W.; Rocktäschel, T.; Riedel, S.; Kiela, D. Retrieval-augmented generation for knowledge-intensive NLP tasks. arXiv, arXiv:2005.11401, 2021. https://doi.org/10.48550/arXiv.2005.11401
» https://doi.org/10.48550/arXiv.2005.11401 -
Luo, B.; Lau, R. Y.; Li, C.; Si, Y. W. A critical review of state-of-the-art chatbot designs and applications. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, v.12, e1434, 2022. https://doi.org/10.1002/widm.1434
» https://doi.org/10.1002/widm.1434 -
Mahajan, Y.; Freestone, M.; Bansal, N.; Aakur, S. N.; Santu, S. K. K. Revisiting word embeddings in the LLM era. arXiv, arXiv:2402.11094, 2024. https://doi.org/10.48550/arXiv.2402.11094
» https://doi.org/10.48550/arXiv.2402.11094 -
Mikolov, T.; Chen, K.; Corrado, G.; Dean, J. Efficient estimation of word representations in vector space. arXiv, arXiv:1301.3781, 2013. https://doi.org/10.48550/arXiv.1301.3781
» https://doi.org/10.48550/arXiv.1301.3781 -
Miranda, G. V.; Molina, O. S.; Carvalho, D.; Andrade, J. da S.; Paula Filho, P. L. de. Sustainable hydroponic lettuce production with artificial lighting and different nutritional irrigation parameters. Chilean Journal of Agricultural Research, v.85, p.299-307, 2025. https://doi.org/10.4067/S0718-58392025000300299
» https://doi.org/10.4067/S0718-58392025000300299 -
Radford, A.; Wu, J.; Child, R.; Luan, D.; Amodei, D.; Sutskever, I. Language models are unsupervised multitask learners. OpenAI Technical Report, 2019. Available at: https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf
» https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf -
Raiaan, M. A. K.; Azam, M. A.; Alam, M. A.; Hossain, M. A.; Rahman, M. M.; Sultana, S.; Hossain, M. S.; Hassan, M. M.; Alshennawy, A.; Alouf, S. A review on large language models: architectures, applications, taxonomies, open issues and challenges. IEEE Access, v.12, p.26839-26874, 2024. https://doi.org/10.1109/ACCESS.2024.3365742
» https://doi.org/10.1109/ACCESS.2024.3365742 -
Reimers, N.; Gurevych, I. Making monolingual sentence embeddings multilingual using knowledge distillation. arXiv, arXiv:2004.09813, 2020. https://doi.org/10.48550/arXiv.2004.09813
» https://doi.org/10.48550/arXiv.2004.09813 -
Reimers, N.; Gurevych, I. Sentence-BERT: sentence embeddings using Siamese BERT-networks. In: Inui, K.; Jiang, J.; Ng, V.; Wan, X. (ed.). Proceedings of the Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), Hong Kong, 2019. p.3982-3992. https://doi.org/10.18653/v1/D19-1410
» https://doi.org/10.18653/v1/D19-1410 -
Sennrich, R.; Haddow, B.; Birch, A. Neural machine translation of rare words with subword units. In: Erk, K.; Smith, N. A. (ed.). Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, Berlin, p.1715-1725, 2016. https://doi.org/10.18653/v1/P16-1162
» https://doi.org/10.18653/v1/P16-1162 -
Souza, F. D.; Souza Filho, J. B. de O. E. Embedding generation for text classification of Brazilian Portuguese user reviews: from bag-of-words to transformers. Neural Computing and Applications, v.35, p.9393-9406, 2023. https://doi.org/10.1007/s00521-022-08068-6
» https://doi.org/10.1007/s00521-022-08068-6 -
Turing, A. M. Computing machinery and intelligence. Mind, v.LIX, p.433-460, 1950. https://doi.org/10.1093/mind/LIX.236.433
» https://doi.org/10.1093/mind/LIX.236.433 -
Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A. N.; Kaiser, L.; Polosukhin, I. Attention is all you need. arXiv, arXiv:1706.03762, 2023. https://doi.org/10.48550/arXiv.1706.03762
» https://doi.org/10.48550/arXiv.1706.03762 -
Zhao, S.; Yang, Y.; Wang, Z.; He, Z.; Qiu, L. K.; Qiu, L. Retrieval augmented generation (RAG) and beyond: a comprehensive survey on how to make your LLMs use external data more wisely. arXiv, arXiv:2409.14924, 2024. https://doi.org/10.48550/arXiv.2409.14924
» https://doi.org/10.48550/arXiv.2409.14924












