EUVIMEDEUVIMED entdecken
Open Access · CC BY 4.0

RAG-Grounded Natural-Language-to-SQL for On-Premise Deployment in Regulated Batch Manufacturing

Luis Rabelo, Juan Zamora-Aguas, Fahad Alasim, Jose Vazquez, Milena Urbina, Gustavo Manfredini, Sean Doolittle, Edgar Gutierrez-Franco

Applied Sciences · 05.11.2026 · 16 (21) · 10971

DOI: 10.3390/app162110971 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Applied Sciences, online erschienen am 05.11.2026. Verfasst von Luis Rabelo und 7 weiteren Autor:innen. Die Arbeit nennt 49 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0). Gefördert von: King Saud University, Riyadh, Saudi Arabia.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

Natural-language access to structured manufacturing data could let plant personnel query batch records without structured query language (SQL) expertise, yet realistic multi-table industrial schemas remain hard for text-to-SQL systems, and regulated environments demand data sovereignty, traceability, and validatable behavior that cloud-hosted models cannot satisfy. This study presents a locally deployable large language model (LLM) system that translates questions into SQL over an ISA-88-aligned database built from a pharmaceutical tablet dataset of 1005 batches. The pipeline combines schema-aware prompting, retrieval-augmented generation (RAG) over validated query examples, execution-based checking, confidence scoring, and human review. Evaluation on 48 questions across three complexity tiers compared a schema-only baseline with five enhancements: controlled vocabularies, retrieved examples, analytical views, execution-guided self-consistency, and schema-specialized fine-tuning. Retrieved examples roughly doubled execution accuracy for two open-weight models, from 23–25% to 46–48%, without reducing accuracy on any question; gains concentrated the 15 two- and three-table join questions, reaching 80%. Fine-tuning a seven-billion-parameter code model on execution-validated synthetic queries raised its accuracy from 19% to 44%, and, combined with retrieval, it achieved the highest observed accuracy on the hardest tier. Results show that a lightweight, auditable, locally deployable pipeline can support regulated manufacturing analytics while flagging outputs that require human validation.

Förderung

  • King Saud University, Riyadh, Saudi Arabia

Zitieren

APA

Rabelo, L., Zamora-Aguas, J., Alasim, F., Vazquez, J., Urbina, M., Manfredini, G., Doolittle, S., & Gutierrez-Franco, E. (2026). RAG-Grounded Natural-Language-to-SQL for On-Premise Deployment in Regulated Batch Manufacturing. Applied Sciences, 16(21), 10971. https://doi.org/10.3390/app162110971

Vancouver

Rabelo L, Zamora-Aguas J, Alasim F, Vazquez J, Urbina M, Manfredini G, et al. RAG-Grounded Natural-Language-to-SQL for On-Premise Deployment in Regulated Batch Manufacturing. Applied Sciences. 2026;16(21):10971. doi:10.3390/app162110971

BibTeX
@article{Rabelo2026,
  author = {Rabelo, Luis and Zamora-Aguas, Juan and Alasim, Fahad and Vazquez, Jose and Urbina, Milena and Manfredini, Gustavo and Doolittle, Sean and Gutierrez-Franco, Edgar},
  title = {RAG-Grounded Natural-Language-to-SQL for On-Premise Deployment in Regulated Batch Manufacturing},
  journal = {Applied Sciences},
  year = {2026},
  volume = {16},
  number = {21},
  pages = {10971},
  doi = {10.3390/app162110971}
}
Kostenlos starten →