arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.19010cs.AI
收藏

AgentNLQ: 一个通用的自然语言到SQL代理

AgentNLQ: A General-Purpose Agent for Natural Language to SQL

JPMorganChase(摩根大通)

Olena Bogdanov, Yeunji Jung, Chandra Dhir, Pareekshitreddy Gaddam, Saurabh Jain, Lakshmi Tumati, Vijay Parthasarathy, Anup Shirgaonkar

AI总结:

本研究提出了一种多代理方法,用于改进自然语言到SQL的转换,该方法在BIRD基准测试中实现了78.1%的语义准确率,并通过优化的多代理解决方案、先进的模式增强方法以及跨不同领域和数据集的评估,展示了方法的准确性和泛化能力。

摘要:

自然语言到SQL(NL2SQL)转换是研究人员和企业关注的重要问题,因为关系数据库在广泛的实际问题中具有普遍的重要性。尽管大语言模型(LLMs)的能力迅速提升,NL2SQL尚未达到与人类专家SQL编写者同等的准确性,因此需要进一步改进NL2SQL算法。本研究提出了一种新的多代理方法用于NL2SQL,该方法在BIg Bench for LaRge-scale Database(BIRD)基准上实现了78.1%的语义准确性。我们的方法利用了用户提供的模式的语义丰富表示,添加了用户提供的业务规则,并生成了准确的SQL查询。本研究的主要贡献包括(a)我们设计了一种优化的多代理解决方案中的新调度器,该调度器利用LLMs进行计划、协调、反思和自我纠正以生成准确的SQL查询;(b)我们开发了一种先进的模式增强方法,创建了上下文感知的元数据以提高准确性;(c)我们通过在BIRD-SQL基准上评估该方法,展示了其在不同领域和数据集上的准确性和泛化能力。

英文摘要:

Natural language to SQL (NL2SQL) conversion is an important problem for researchers and enterprises due to the ubiquitous importance of relational databases in broad-ranging practical problems. Despite the rapid advancements in the capabilities of LLMs, NL2SQL has not reached parity in accuracy with human expert SQL writers, hence needing additional improvements in NL2SQL algorithms. This study presents a new multi-agent method for NL2SQL that achieves 78.1% semantic accuracy on the BIg Bench for LaRge-scale Database (BIRD) benchmark. Our method leverages a semantically enriched representation of user-provided schema, adds user-provided business rules, and produces accurate SQL queries. The main contributions of this study are (a) We designed an optimized new orchestrator in a multi-agent solution that uses LLMs to plan, orchestrate, reflect, and self-correct to generate accurate SQL queries, (b) We developed an advanced schema enrichment method that creates context-aware metadata to improve accuracy, and (c) We demonstrated the accuracy and generalizability of the method across different domains and datasets by evaluating it on the BIRD-SQL benchmark.

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

↑