Uppsats

Trustworthy Query Automation for Property Management: From Natural Language to Safe SQL : Reducing Risk in Automated Reporting with Constrained SQL Generation

Kandidat-uppsats

KTH/Hälsoinformatik och logistik

Publicerad: 2026

Språk: Engelska

Sammanfattning

Natural-language interfaces to relational databases have improved significantly with the emergence of large language models, yet their deployment in enterprise settings remains constrained by safety, governance, and cost requirements. This thesis investigates how a governed Retrieval-Augmented Generation (RAG) pipeline can be used to translate natural-language queries into safe, read-only SQL queries within a property-management domain. The proposed system combines embedding-based retrieval, intent abstraction, and schema- and policy-aware prompt construction with an explicit safety gate enforcing role-based access control, bounded scans, and auditability. Rather than focusing on model scaling, the study evaluates how representation strategy and vector-space structure affect retrieval accuracy, ambiguity, and robustness. Experimental results show that intent-based and hybrid embedding representations significantly improve similarity separation, reduce ambiguity under paraphrasing,and enable scalable expansion of supported functionality at low computational cost. The findings demonstrate that carefully designed embedding and context construction strategies yield substantial performance gains without increasing reliance on large or expensive language models, supporting safe and practical deployment of Text-to-SQL systems in enterprise environments.

Utforska vidare

Liknande uppsatser

Uppsatser med liknande ämnen och nyckelord.