arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.15709cs.AIcs.DBcs.LG
收藏

AgentSM: 语义记忆用于代理文本到SQL

AgentSM: Semantic Memory for Agentic Text-to-SQL

Amazon Web Services(亚马逊网络服务);University of California, Berkeley(加州大学伯克利分校);Oracle Corporation(甲骨文公司);Snowflake Inc.(Snowflake公司)

Asim Biswal, Chuan Lei, Xiao Qin, Aodong Li, Balakrishnan Narayanaswamy, Tim Kraska

AI总结:

AgentSM通过构建可解释的语义记忆,提升文本到SQL任务的效率和准确性,减少令牌使用和轨迹长度,达到更高执行精度。

摘要:

最近基于大语言模型的文本到SQL方法在公共基准如BIRD和Spider上取得了显著进展。然而,这些系统在现实企业环境中难以扩展,因为它们需要处理大规模、复杂的模式,多样的SQL方言以及昂贵的多步推理。新兴的代理方法显示出适应性推理的潜力,但往往效率低下且不稳定——与数据库重复交互,产生不一致的输出,偶尔无法生成有效的答案。为了解决这些挑战,我们引入了Agent Semantic Memory(AgentSM),一种用于文本到SQL的代理框架,它构建并利用可解释的语义记忆。AgentSM不依赖于原始草稿或向量检索,而是捕获先前执行轨迹或合成经过筛选的轨迹作为结构化程序,直接引导未来的推理。这种设计使推理路径的系统性重用成为可能,使代理能够高效且可靠地扩展到更大的模式、更复杂的问题和更长的轨迹。与最先进的系统相比,AgentSM在Spider 2.0基准上通过将平均令牌使用量和轨迹长度分别减少25%和35%提高了效率。它还提高了执行准确性,在Spider 2.0 Lite基准上达到了44.8%的最先进准确性。

英文摘要:

Recent advances in LLM-based Text-to-SQL have achieved remarkable gains on public benchmarks such as BIRD and Spider. Yet, these systems struggle to scale in realistic enterprise settings with large, complex schemas, diverse SQL dialects, and expensive multi-step reasoning. Emerging agentic approaches show potential for adaptive reasoning but often suffer from inefficiency and instability-repeating interactions with databases, producing inconsistent outputs, and occasionally failing to generate valid answers. To address these challenges, we introduce Agent Semantic Memory (AgentSM), an agentic framework for Text-to-SQL that builds and leverages interpretable semantic memory. Instead of relying on raw scratchpads or vector retrieval, AgentSM captures prior execution traces-or synthesizes curated ones-as structured programs that directly guide future reasoning. This design enables systematic reuse of reasoning paths, which allows agents to scale to larger schemas, more complex questions, and longer trajectories efficiently and reliably. Compared to state-of-the-art systems, AgentSM achieves higher efficiency by reducing average token usage and trajectory length by 25% and 35%, respectively, on the Spider 2.0 benchmark. It also improves execution accuracy, reaching a state-of-the-art accuracy of 44.8% on the Spider 2.0 Lite benchmark.

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

↑