arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.25997cs.AIcs.SE
收藏

从抽象到洞察:时空文本到SQL的抽象LLM管道

From Queries to Insights: Agentic LLM Pipelines for Spatio-Temporal Text-to-SQL

University of Kansas(堪萨斯大学)

Manu Redd, Tao Zhe, Dongjie Wang

摘要:

自然语言到SQL(NL-to-SQL)系统有望实现对结构化数据的民主化访问,允许用户在不学习SQL的情况下查询数据库。然而,现有的系统挣扎与现实的时空查询,成功需要调整模糊的用户措辞与特定模式的类别,处理时间推理,并选择适当的输出。我们提出了一个代理管道,它扩展了一个天真的文本到SQL基线(llama-3-sqlcoder-8b),并通过基于Mistral的ReAct代理进行编排。代理可以通过模式检查、SQL生成、执行和可视化工具来计划、分解和调整查询。我们评估了35个自然语言查询在纽约市和东京签入数据集,涵盖空间,时间和多数据集推理。该代理实现了比原始基线91.4%对28.6%更高的准确性,并通过地图,图表和结构化的自然语言摘要增强了可用性。至关重要的是,我们的设计能够实现更自然的人机交互,支持缺乏SQL专业知识、详细的模式知识或提示技能的用户。我们的结论是,代理编排,而不是更强大的SQL生成器单独,是一个很有前途的基础交互式地理空间助理。

英文摘要:

Natural-language-to-SQL (NL-to-SQL) systems hold promise for democratizing access to structured data, allowing users to query databases without learning SQL. Yet existing systems struggle with realistic spatio-temporal queries, where success requires aligning vague user phrasing with schema-specific categories, handling temporal reasoning, and choosing appropriate outputs. We present an agentic pipeline that extends a naive text-to-SQL baseline (llama-3-sqlcoder-8b) with orchestration by a Mistral-based ReAct agent. The agent can plan, decompose, and adapt queries through schema inspection, SQL generation, execution, and visualization tools. We evaluate on 35 natural-language queries over the NYC and Tokyo check-in dataset, covering spatial, temporal, and multi-dataset reasoning. The agent achieves substantially higher accuracy than the naive baseline 91.4% vs. 28.6% and enhances usability through maps, plots, and structured natural-language summaries. Crucially, our design enables more natural human-database interaction, supporting users who lack SQL expertise, detailed schema knowledge, or prompting skill. We conclude that agentic orchestration, rather than stronger SQL generators alone, is a promising foundation for interactive geospatial assistants.

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

↑