arXiv cs.AI· Anjali Vemula, Akshat Dasula·· 12 小时前AI 评分26
基于多智能体迭代自优化的 NL2SQL 框架
NL2SQL with Iterative Self-Refinement
AI 导读
研究者提出一种多智能体、角色驱动的 NL2SQL 框架,融合领域相关性检测、schema 知识构建、KPI 感知 SQL 合成、基于 sqlite 执行反馈的语法级自修复与 SQL-to-NL 反向工程的语义一致性检查。
正文 · 原文
Abstract:Bridging the gap between human intent and machine logic remains a critical challenge in data access for non-technical users, yet Large Language Models (LLMs) remain unreliable: they hallucinate schema elements, generate syntactically invalid queries, or fail to capture user intent. These limitations are especially critical in domains such as insurance, where KPIs, regulatory constraints, and legacy relational systems demand high precision. We introduce a multi-agent, persona-driven NL2SQL framework that combines (1) domain relevance detection, (2) schema-grounded knowledge construction, (3) KPI-aware SQL synthesis, (4) syntax-level self-repair using sqlite execution feedback, and (5) semantic consistency checking via SQL-to-NL reverse engineering. Our system significantly reduces query hallucination and improves semantic fidelity compared to direct LLM prompting. Evaluated on 60 queries (50 from a HuggingFace text-to-SQL dataset and 10 custom domain queries), the system achieves 90% correctness using Mistral across seven coordinated LLM calls showing that this approach can substantially increase the reliability of NL2SQL pipelines in high-stakes environments.
| Subjects: | Databases (cs.DB); Artificial Intelligence (cs.AI) |
| Cite as: | arXiv:2610.22968 [cs.DB] |
| (or arXiv:2610.22968v1 [cs.DB] for this version) | |
| https://doi.org/10.48550/arXiv.2610.22968 arXiv-issued DOI via DataCite (pending registration) |
Submission history
From: Anjali Vemula [view email]
[v1]
Fri, 16 Oct 2026 05:39:18 UTC (538 KB)
来源:arXiv cs.AI · arxiv.org