From Questions to Queries: An AI-powered Multi-Agent Framework for Spatial Text-to-SQL
Ali Khosravi Kazazi, Zhenlong Li, M. Naser Lessani, Guido Cervone

TL;DR
This paper presents a multi-agent framework that improves spatial Text-to-SQL translation accuracy by decomposing the task into specialized stages, enhancing robustness for spatial queries.
Contribution
The novel multi-agent approach effectively addresses spatial semantics and schema ambiguities, achieving higher accuracy on spatial Text-to-SQL benchmarks.
Findings
Achieved 81.2% accuracy on KaggleDBQA benchmark.
Achieved 87.7% accuracy on SpatialQueryQA benchmark.
Decomposition into agents improves robustness for spatial queries.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
