Tillförlitlig frågeautomatisering för fastighetsförvaltning: från naturligt språk till säker SQL : Minskning av risk i automatiserad rapportering med begränsad SQL-generering

Read full text
Authors: Ethar Ahmed
Cited by: 0

Abstract

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.

Fields of Study & Subjects

Topic Modeling Natural Language Processing Techniques Information Retrieval and Search Behavior

Publication details

Journal / source
KTH Publication Database DiVA (KTH Royal Institute of Technology)
Publication date
1 January 2026
Language
EN
Document type
Thesis