Can AI Truly Understand Natural Language Queries in Greenhouse Data?

Can AI Truly Understand Natural Language Queries in Greenhouse Data?

Telemetry recorded at a one-minute cadence provides high-density data on vapor pressure deficit, enthalpy, and dew points, creating a rigorous foundation for AI query testing. This granular approach to monitoring is central to the QUILLAMA project, a specialized service integrated into the broader QUILLAQUA agricultural framework. As precision agriculture moves beyond simple automated timers and predefined thresholds, the industry is increasingly looking toward large language models to bridge the gap between complex relational databases and the natural language of human operators. The promise is significant: allowing a grower or a technician to ask a simple question and receive a technically accurate, data-driven answer. However, the implementation of such systems in a high-stakes greenhouse environment reveals a complicated reality where technical success in code generation does not always translate into a true understanding of a user’s biological or operational intent. By focusing on the intersection of generative AI and real-time environmental data, researchers are now uncovering the critical limits of machine comprehension in specialized industrial contexts.

The Physical and Architectural Foundation

Data Generation in the QUILLAQUA Ecosystem

The empirical research was conducted within a meticulously controlled greenhouse facility primarily dedicated to high-yield lettuce cultivation. This site serves as more than just a production center; it is a high-density data hub where every environmental shift is logged. Beyond the primary lettuce crops, the facility also houses a diverse array of secondary plants including basil, celery, parsley, and various pepper varieties. This diversity ensures that the telemetry captured reflects a complex biological environment rather than a sterile laboratory setting. Throughout a 313-day period spanning from late 2025 into mid-2026, the system accumulated over 370,000 distinct records, providing a massive longitudinal dataset for testing AI query accuracy.

The underlying data schema is remarkably robust, featuring thirty-five columns that track everything from basic climate metrics to complex psychrometric properties. Specifically, the system monitors variables such as vapor pressure deficit and dew point across five strategic locations, including the top, sides, and exterior of the facility. Additionally, the database records the operational status of thirteen mechanical units, such as lateral extractors and misting systems. With a recording cadence of approximately one minute and a data integrity rate of over ninety-nine percent, the MariaDB repository offers a clean, high-resolution mirror of the physical greenhouse operations, making it an ideal testbed for evaluating how well an artificial intelligence can navigate structured agricultural information.

Distributed Edge Computing and Safety Design

The architecture of the QUILLAMA service is built upon a distributed edge-computing topology, which is essential for maintaining system stability in an agricultural setting. By separating the computationally heavy language processing from the real-time hardware control, the engineers ensured that AI inference tasks do not interfere with the deterministic nature of greenhouse life support. Three discrete microcontrollers—designated as E-Ctrl, H-Ctrl, and N-Ctrl—manage the environment, hydroponics, and nutrient delivery respectively. These units communicate via an encrypted Mosquitto MQTT broker, while a Raspberry Pi 4 serves as the central orchestration unit running Node-RED software. This separation of concerns allows the AI to function as an observational overlay without risking the core automation logic.

A foundational principle of this design is the strict “read-only” isolation of the AI components. The QUILLAMA service is physically and logically barred from actuating relays, adjusting nutrient concentrations, or altering microclimate setpoints. This safety-first approach is a direct response to the known risks of AI hallucinations, where a model might confidently generate a command that could inadvertently harm the crops or damage the facility’s infrastructure. By restricting the AI to querying historical and real-time telemetry, the research team created a system that can provide deep insights while remaining incapable of physical interference. This ensures that the greenhouse operator remains the sole decision-maker for all active management tasks, using the AI only as a sophisticated data-retrieval assistant.

The Technical Workflow of QUILLAMA

The Four-Stage Query Pipeline Logic

The process of turning a human question into a technical answer follows a rigorous four-stage pipeline designed for both accuracy and security. When a user submits a natural language query, it is first processed by the qwen2.5-coder:14b model, which is specifically tasked with translating the request into structured SQL. This model operates under strict “zero temperature” settings to ensure consistency and uses a specialized prompt that includes the entire database schema and domain-specific synonyms. This initial translation is the most complex part of the journey, as the AI must map informal terms like “how hot was it yesterday” to specific columns and time ranges within the relational database.

Once the SQL code is generated, it immediately enters a security validation stage that acts as a digital gatekeeper. This stage employs application-level guardrails to normalize the code and enforce a strict “SELECT-only” policy, which automatically blocks any attempts to modify or delete data. Following a successful security check, the query is executed against the MariaDB database via Node-RED, retrieving a limited set of relevant records. In the final stage, a general-purpose language model synthesizes these raw data points into a conversational narrative. This multi-step approach ensures that the final output is not just a table of numbers, but a coherent summary in English or Spanish that highlights averages, trends, and specific environmental anomalies.

User Interaction and Latency Performance

Accessibility is a key focus of the QUILLAMA interface, which provides greenhouse managers with two distinct ways to interact with their data. A dedicated administrative web console offers a comprehensive view for office-based analysis, while a secure Telegram bot allows for mobile querying directly from the greenhouse floor. The Telegram interface is particularly effective for on-site troubleshooting, as it utilizes deep-link enrollment and administrator verification to maintain security on personal devices. This dual-channel approach ensures that data is always reachable, whether a manager is conducting a deep-dive review of crop performance or simply checking a specific sensor’s status while walking through the rows of lettuce.

System performance metrics indicate that this localized edge-computing approach is highly viable for real-world agricultural operations. The average latency for the entire query-to-answer pipeline sits at approximately 3.39 seconds, which includes the time needed to load the models into memory. However, when the system is in active use and the models are already “warm,” this response time drops to a median of just 1.22 seconds. This level of responsiveness is crucial for maintaining a natural conversational flow and demonstrates that high-performance AI can be deployed on relatively modest hardware without relying on expensive and potentially unreliable cloud-based connections. The localized nature of the computing also preserves data privacy and ensures the system remains functional even if external internet access is interrupted.

Analyzing the Gap in AI Understanding

Technical Success Versus Semantic Accuracy

The most profound insight from the research is the stark difference between an AI’s ability to write functional code and its ability to understand a user’s actual intent. In testing, the QUILLAMA system achieved a remarkable 93.8 percent success rate in generating syntactically correct SQL that the database could execute without error. This suggests that the AI is highly proficient at the technical mechanics of programming. However, the “semantic assessment” revealed a significant hurdle: only 59.4 percent of those executed queries actually answered what the user had intended to ask. This 34.4 percent “semantic gap” is the primary challenge facing the next generation of conversational agricultural tools.

The failures in semantic understanding were often subtle but impactful, stemming from the AI’s tendency to make arbitrary assumptions when faced with vague language. For example, if a user asked for “the temperature,” the model might default to an all-time average instead of the most recent reading, or it might select a sensor at the side of the greenhouse when the user was interested in the center. Because the model lacks the social intelligence to ask for clarification, it proceeds with a technically perfect query that produces the wrong information. This discrepancy highlights that in a specialized field like horticulture, being “correct” in a coding sense is not enough; the system must also possess enough contextual awareness to navigate the inherent ambiguities of human speech.

Risks of Narrative Synthesis and Hallucination

A second critical risk identified in the study involves the narrative synthesis stage, where the AI summarizes the retrieved data for the user. Because these models are primarily trained on linguistic patterns rather than biological science, they can inadvertently generate a “hallucination of expertise.” For instance, a summary might describe a specific temperature range as “fairly cool” or “optimal” based on common word associations rather than the actual physiological needs of the lettuce crop. This persuasive prose can be misleading, as it presents a statistical summary as if it were a professional agronomic assessment. Without actual biological training, the AI is merely performing a sophisticated form of data storytelling that lacks scientific grounding.

To measure the depth of this issue, the researchers employed Sentence-BERT to compare the AI’s narrative descriptions against manual expert classifications. The results showed only a moderate correlation, reinforcing the idea that textual similarity is a poor substitute for genuine understanding. This poses a unique risk in an agricultural setting where a manager might take a specific action based on a misleadingly confident summary. The danger is not that the AI gives a wrong number, but that it wraps that number in a narrative that makes it sound scientifically sound. This “hallucination of expertise” underscores the need for users to treat AI summaries as statistical descriptions rather than authoritative biological advice.

Building Reliable AI for Agriculture

Guardrails: How the System Prevents Unauthorized Changes

Protecting the integrity of historical telemetry is a non-negotiable requirement for any system that interacts with greenhouse records. The QUILLAMA framework achieves this through a robust application-level guardrail that inspects every generated SQL statement before it reaches the database. By strictly enforcing a “SELECT-only” policy, the system acts as a unidirectional filter that allows data to be read but never altered or removed. Any query containing restricted keywords like DELETE, DROP, or UPDATE is caught and rejected by the Node-RED orchestration layer. This ensures that even if an AI model is manipulated through prompt injection or experiences a severe logic failure, the underlying data remains untouched and pristine.

This security layer is particularly important because AI models are inherently unpredictable and can be prone to “jailbreaking” attempts where users try to bypass safety filters. In testing, the QUILLAMA guardrails were subjected to nineteen adversarial injection attempts, and the system successfully blocked every single one. This one-hundred-percent success rate in security testing demonstrates that while the AI’s understanding may be imperfect, its potential for causing data-level damage can be effectively neutralized through traditional software engineering principles. Maintaining this “read-only” stance is a critical best practice for deploying large language models in industrial environments where data history is a vital asset for long-term crop research and financial auditing.

Clarification: Can the AI Handle Vague Questions?

The current limitation of conversational AI in the greenhouse is its inability to recognize and resolve ambiguity through dialogue. During the study, the system was frequently tested with vague parameters—such as failing to specify a date or a sensor location—to see how it would respond. In almost every instance, the AI made an arbitrary guess rather than pausing to ask the user for more information. This behavior is a byproduct of how modern models are trained to be helpful and direct, but in a technical agricultural context, it can lead to the “semantic gap” previously described. The lack of a “clarification loop” means that the burden of precision still rests entirely on the human operator.

To address this, future iterations of greenhouse AI must move toward a more interactive “human-in-the-loop” model. Instead of immediately generating a query, the system should be programmed to identify missing variables and respond with clarifying questions, such as asking which specific growing zone the user is referring to. This iterative process would significantly narrow the gap between technical execution and user intent. By shifting the AI’s role from a passive translator to an active participant in the query-building process, developers can create a much more reliable tool that ensures the data retrieved is exactly what the manager needs to make informed decisions about crop health.

Future Roadmap: Closing the Semantic Gap

The research into QUILLAMA from 2026 and beyond established a clear path forward for the integration of conversational AI in digital agriculture. To close the semantic gap, the next phase of development must focus on grounding language models in domain-specific agronomic knowledge. This involves moving beyond general-purpose models and training systems on specialized datasets that include plant physiology, greenhouse mechanics, and regional climate patterns. Such a foundation would allow the AI to move from statistical summaries to summaries that are biologically relevant, ensuring that a description of “optimal conditions” is based on scientific reality rather than linguistic probability.

Furthermore, the industry is trending toward more sophisticated semantic mapping that can better handle the complexities of greenhouse operations. This includes developing ontologies that link various sensors and actuators together, allowing the AI to understand the relationships between different environmental factors. By combining these technical advancements with robust security guardrails and human-centric clarification dialogues, the goal is to create an interface that is both accessible to non-technical staff and reliable enough for high-stakes decision-making. These steps will transform AI from a simple data-access tool into a trustworthy partner in the ongoing effort to optimize global food production through precision technology.

Subscribe to our weekly news digest.

Join now and become a part of our fast-growing community.

Invalid Email Address
Thanks for Subscribing!
We'll be sending you our best soon!
Something went wrong, please try again later