arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2510.21045cs.AIcs.DBcs.IR
收藏

从问题到查询:一种基于AI的多智能体框架用于空间文本到SQL

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

Geoinformation and Big Data Research Laboratory, Department of Geography, The Pennsylvania State University(宾夕法尼亚州立大学地理系地理信息与大数据研究实验室);Institute for Computational and Data Sciences and Department of Geography, The Pennsylvania State University(宾夕法尼亚州立大学计算与数据科学研究所及地理系)

Ali Khosravi Kazazi, Zhenlong Li, M. Naser Lessani, Guido Cervone

AI总结:

本文提出一种基于AI的多智能体框架,解决空间文本到SQL中的复杂问题,通过分阶段解释、模式绑定、逻辑规划和执行审查提升空间查询的鲁棒性。

摘要:

SQL的复杂性和PostGIS的空间语义为非专家处理空间数据设置了障碍。尽管大语言模型可以将自然语言转换为SQL,但空间文本到SQL比通用文本到SQL更易出错,因为它必须解决地理意图、模式模糊性、包含几何的表和列、空间函数选择以及坐标参考系统和测量假设。我们引入了一个多智能体框架,通过分阶段解释、模式绑定、逻辑规划、SQL生成和基于执行的审查来解决这些耦合的挑战。该框架由一个知识库支持,该知识库具有程序化模式配置文件、语义丰富和基于嵌入的检索。我们评估了该框架在非空间的KaggleDBQA基准和新的多级和覆盖导向的基准SpatialQueryQA上。在KaggleDBQA上,系统在审查员修正后达到81.2%的准确率,221/272个问题。在SpatialQueryQA上,系统达到87.7%的准确率,79/90,相比无审查阶段的76.7%。这些结果表明,将任务分解为专门但紧密耦合的智能体可以提高鲁棒性,特别是对于空间敏感查询。本研究提高了空间分析的可访问性,并为更可靠的空文本到SQL系统和自主GIS提供了实际步骤。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑