From Questions to Queries: An AI-powered Multi-Agent Framework for Spatial Text-to-SQL

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Kazazi, Ali Khosravi, Li, Zhenlong, Lessani, M. Naser, Cervone, Guido
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866914428339879936
author Kazazi, Ali Khosravi
Li, Zhenlong
Lessani, M. Naser
Cervone, Guido
author_facet Kazazi, Ali Khosravi
Li, Zhenlong
Lessani, M. Naser
Cervone, Guido
contents The complexity of SQL and the spatial semantics of PostGIS create barriers for non-experts working with spatial data. Although large language models can translate natural language into SQL, spatial Text-to-SQL is more error-prone than general Text-to-SQL because it must resolve geographic intent, schema ambiguity, geometry-bearing tables and columns, spatial function choice, and coordinate reference system and measurement assumptions. We introduce a multi-agent framework that addresses these coupled challenges through staged interpretation, schema grounding, logical planning, SQL generation, and execution-based review. The framework is supported by a knowledge base with programmatic schema profiling, semantic enrichment, and embedding-based retrieval. We evaluated the framework on the non-spatial KaggleDBQA benchmark and on SpatialQueryQA, a new multi-level and coverage-oriented benchmark with diverse geometry types, workload categories, and spatial operations. On KaggleDBQA, the system reached 81.2% accuracy, 221 of 272 questions, after reviewer corrections. On SpatialQueryQA, the system achieved 87.7% accuracy, 79 of 90, compared with 76.7% without the review stage. These results show that decomposing the task into specialized but tightly coupled agents improves robustness, especially for spatially sensitive queries. The study improves access to spatial analysis and provides a practical step toward more reliable spatial Text-to-SQL systems and autonomous GIS.
format Preprint
id arxiv_https___arxiv_org_abs_2510_21045
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle From Questions to Queries: An AI-powered Multi-Agent Framework for Spatial Text-to-SQL
Kazazi, Ali Khosravi
Li, Zhenlong
Lessani, M. Naser
Cervone, Guido
Artificial Intelligence
Databases
Information Retrieval
The complexity of SQL and the spatial semantics of PostGIS create barriers for non-experts working with spatial data. Although large language models can translate natural language into SQL, spatial Text-to-SQL is more error-prone than general Text-to-SQL because it must resolve geographic intent, schema ambiguity, geometry-bearing tables and columns, spatial function choice, and coordinate reference system and measurement assumptions. We introduce a multi-agent framework that addresses these coupled challenges through staged interpretation, schema grounding, logical planning, SQL generation, and execution-based review. The framework is supported by a knowledge base with programmatic schema profiling, semantic enrichment, and embedding-based retrieval. We evaluated the framework on the non-spatial KaggleDBQA benchmark and on SpatialQueryQA, a new multi-level and coverage-oriented benchmark with diverse geometry types, workload categories, and spatial operations. On KaggleDBQA, the system reached 81.2% accuracy, 221 of 272 questions, after reviewer corrections. On SpatialQueryQA, the system achieved 87.7% accuracy, 79 of 90, compared with 76.7% without the review stage. These results show that decomposing the task into specialized but tightly coupled agents improves robustness, especially for spatially sensitive queries. The study improves access to spatial analysis and provides a practical step toward more reliable spatial Text-to-SQL systems and autonomous GIS.
title From Questions to Queries: An AI-powered Multi-Agent Framework for Spatial Text-to-SQL
topic Artificial Intelligence
Databases
Information Retrieval
url https://arxiv.org/abs/2510.21045