In an experimental smart greenhouse deployment, researchers have demonstrated that artificial intelligence can reliably query complex operational databases using natural language, but an absence of database errors does not guarantee that the system understood what the user actually asked. The study, documented by Diego F. Bustamante V and colleagues in Smart Agricultural Technology, details the implementation and empirical evaluation of QUILLAMA, a specialized data-access service integrated into the deployed QUILLAQUA agricultural monitoring framework. By processing operational questions through an end-to-end natural-language-to-database pipeline, the system achieved a technical database execution rate of 93.8 percent across thirty-two operational queries. However, a rigorous retrospective semantic assessment revealed that only 59.4 percent of the generated structured query statements accurately reflected the user’s operational intention. This substantial gap of 34.4 percentage points indicates that successful database execution alone cannot serve as an adequate proxy for semantic fidelity in autonomous agricultural query systems, highlighting critical challenges in translating human intent into relational queries.
The physical testbed providing the empirical data for this evaluation is a functioning, controlled horticultural facility where lettuce serves as the primary crop alongside secondary plantings of basil, celery, parsley, romanesco, pepper plants, and head lettuce. This varied cultivation environment operates under the QUILLAQUA digital agriculture framework, which continuously gathers environmental telemetry and logs actuator events into an operational MariaDB relational database known as the QDB schema. At the final manuscript evaluation cut-off, the underlying historical repository, designated QDB.lecturas, had accumulated 370,706 records spanning a 313-day calendar window from early September 2025 to mid-July 2026. Across this timeframe, data was recorded on 269 distinct calendar days, with 44 days showing no recorded entries due to downtime or planned non-operation. The logged telemetry maintained an approximately one-minute collection cadence, where consecutive reading intervals of 60, 61, or 62 seconds accounted for 98.8 percent of all positive time differences, with 61 seconds being the modal interval.
The database schema encompasses thirty-five distinct columns designed to monitor the greenhouse climate, derived psychrometric properties, and the operational status of physical equipment without synthetic data generation. Environmental tracking involves twenty variables, including distributed temperature channels T1 through T5 and humidity channels H1 through H5 positioned across the top, left, middle, right, and exterior locations. These are complemented by consolidated greenhouse temperature and relative humidity metrics, external references gathered from OpenWeatherMap, ambient light levels, and five derived psychrometric variables covering vapor pressure deficit, absolute humidity, enthalpy, dew point, and heat index. The remaining thirteen attributes log the discrete states of physical machinery, covering ten lateral extractors arranged in five pairs, two internal extractor fans labeled A11 and A12, and a dedicated misting unit designated HA10 used for hygrothermal regulation. Across this vast multi-month repository of nearly thirteen million individual data cells, missing values were observed in only 0.80 percent of cells, distributed across 7.58 percent of rows.
To coordinate the physical facility, the underlying QUILLAQUA platform implements a distributed edge-computing topology that separates real-time hardware control from language-driven data exploration. Three embedded microcontrollers manage discrete operational duties: E-Ctrl monitors environmental conditions and operates extractor relays, H-Ctrl oversees the hydroponic systems and misting hardware, and N-Ctrl represents the nutrient-tank subsystem. Telemetry and commands travel through an internal Mosquitto messaging broker secured by encrypted MQTT and Transport Layer Security protocols, while remote maintenance relies on SSH connections within a protected virtual network. A centralized Master Control unit running on a Raspberry Pi 4 executes Node-RED orchestration software, handling MariaDB data logging alongside web interfaces. QUILLAMA integrates directly into this orchestration layer as a non-intrusive query service exposed through a dedicated local endpoint. Crucially, the engineering design isolates QUILLAMA purely as an observational data-access interface, explicitly excluding autonomous agronomic control, predictive microclimate manipulation, or direct physical relay actuation.
When an operator poses an inquiry through the designated query endpoint, the pipeline processes the question through a four-stage translation architecture linking natural language, structured query generation, database retrieval, and narrative synthesis. Natural language questions are initially passed via local HTTP requests to an on-premises Ollama inference service running in an isolated virtual machine equipped with four virtual processor cores, 30 gigabytes of system memory, and a dedicated graphics processing unit. To translate natural language into executable database code, the pipeline invokes the specialized code-generation model qwen2.5-coder:14b under strict parameters, including zero temperature, a 4,096-token context window, and a 256-token generation cap. The generation prompt embeds the lecturas database schema, operational domain synonyms, temporal interpretation guidelines, and a curated catalog of reference query demonstrations capped at 12,000 characters. This rigorous static prompting configuration constrains the model to emit a single read-only query statement while discouraging the invention of non-existent tables or attributes.
Because artificial intelligence models are prone to hallucination and prompt exploitation, candidate database statements are treated as untrusted intermediate code that must satisfy application-level security guardrails before database transmission. The pre-execution validation routine normalizes incoming text by stripping markdown code fences, compacting internal whitespace, and performing targeted lexical substitution, such as converting Spanish terms like Luz into the official column label L. Most importantly, the validator enforces a strict no-write security policy by verifying that every statement begins exclusively with the SELECT command while outright rejecting chained statements demarcated by semicolons. Statements containing prohibited modification or schema-altering commands, such as INSERT, UPDATE, DELETE, DROP, TRUNCATE, ALTER, or administrative privilege instructions, are blocked before reaching MariaDB. Although this syntactic parsing provides deterministic protection against unauthorized alterations, the researchers noted that it lacks deep structural Abstract Syntax Tree analysis or automated result-cardinality limits, leaving open possibilities for benign queries to fail on invalid column names.
Queries cleared by the validation filter execute against MariaDB through Node-RED, which passes the resulting tabular dataset, restricted to a fifty-row preview, to a second language-model stage responsible for narrative synthesis. This explanatory stage utilizes the general-purpose qwen2.5:14b model operating at zero temperature with a 1,024-token context window and a 220-token limit to convert raw rows into neutral English or Spanish summaries. The narrative prompt instructs the model to describe central averages, bounding ranges, and chronological stability while explicitly warning users when no matching records exist. However, because this explanatory layer lacks programmatic agronomic thresholds or plant-health classification logic, descriptive qualitative phrases generated by the language model, such as calling an average temperature fairly cool, represent unvalidated prose rather than verified biological assessments. Every endpoint response bundles the narrative answer, returned column names, structured data rows, the executed query, and the originating channel into a single traceable JSON object.
Users can interact with this query architecture through two distinct channels: an administrative web console and an authorized Telegram messaging bot. The Telegram adapter incorporates chat-level security controls, including deep-link token enrolment, administrator verification, and client rate limiting, before standardizing inbound messages into the shared backend query format. While Telegram delivers compact conversational replies optimized for mobile screens, the web dashboard displays comprehensive audit information, exposing the natural language narrative alongside the exact query executed and previews of retrieved records. To characterize the performance of narrative generation, the researchers logged thirty-seven instrumented DB-to-NL service calls, recording an average response latency of 3.39 seconds, a median duration of 2.85 seconds, and a ninety-fifth percentile mark of 7.32 seconds. When excluding initial model memory loading overhead, the mean narrative execution time dropped to 1.72 seconds with a median of 1.22 seconds, confirming reasonable local responsiveness.
The system underwent rigorous empirical validation through the S01-S54 test suite, comprising fifty-four predefined scenarios that tested operational queries, synonym resolution, ambiguous inquiries, infrastructure disruptions, and adversarial attacks. Across nineteen adversarial injection attempts, the application-level validator demonstrated absolute enforcement of the no-write policy, registering zero false positives and zero false negatives. The filter successfully blocked fifteen malicious inputs containing chained commands or prohibited modification keywords, while the remaining four attempts were safely transformed by the model into benign SELECT statements. Among the thirty-two non-adversarial operational queries, thirty executed successfully without database errors, while two failed due to schema mismatches involving non-existent columns. Nevertheless, subsequent expert evaluation of these thirty-two operational cases across five semantic dimensions revealed significant interpretive vulnerabilities: column selection was accurate in 81.3 percent of cases, temporal scoping reached 80.6 percent, query operations achieved 78.1 percent, and result granularity reached 90.6 percent.
Crucially, the system failed every ambiguity-handling test, scoring zero out of four when questions omitted critical parameters like specific sensor channels or explicit time boundaries. Rather than requesting clarification, the model arbitrarily selected variables or default time intervals, occasionally misinterpreting current status requests as all-time historical extremes or counting periodic telemetry samples as physical motor activations. Complementary semantic textual similarity evaluations using Sentence-BERT yielded a moderate overall Spearman correlation of 0.529 against manual classifications, further demonstrating that semantic fidelity requires structured verification rather than simple textual matching. The investigators concluded that deploying conversational interfaces in precision agriculture demands defense-in-depth engineering, including least-privilege database roles, structural query allowlists, automated row-count constraints, and human-in-the-loop clarification dialogues. By establishing an open-source benchmark that decouples syntactic database execution from semantic comprehension, this work provides a transparent foundation for developing traceable, reliable natural-language interfaces in high-value agricultural operations.
Subject of Research: Natural language query interfaces and read-only guardrails for operational smart greenhouse databases
Article Title: QUILLAMA: Traceable natural language access to operational smart greenhouse data with read only guardrails
Article References: Bustamante V, D. F., Sánchez, L. E., Rosado, D. G., Santos-Olmo, A., & Fernández-Medina, E. (2026). QUILLAMA: Traceable natural language access to operational smart greenhouse data with read only guardrails. Smart Agricultural Technology, 15, Article 102681. https://doi.org/10.1016/j.atech.2026.102681
Image Credits: AI Generated
DOI: 10.1016/j.atech.2026.102681
Keywords: QUILLAMA, QUILLAQUA, smart greenhouse, text-to-SQL, digital agriculture, MariaDB, Node-RED, read-only guardrails, natural language interfaces, Ollama, qwen2.5-coder, query traceability, semantic correspondence, horticultural telemetry, Raspberry Pi, database security, Sentence-BERT
News Source: Alan Morgan. (November 12, 2026). Smart Greenhouse AI Queries Run Reliably but Often Misinterpret User Meaning. Scienmag.



