Database
NL2SQL with Iterative Self-Refinement
arXiv cs.DB0 views
arXiv:2610.22968v1 Announce Type: new 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.
Source:https://arxiv.org/abs/2610.22968PreviousFuseRAG: Fusing Structure and Evidence into Inference for Cost-Efficient Graph-based RAGNextAn Error Taxonomy for Property Graph Data
Related posts
I Cut 2,000 Flushes to Zero and fsync Still Returned Success
0dev.to Linux
Magnus Hagander: Nordic PGDay 2027 - Sponsorships for Nordic PGDay 2027 Are Now Open
0Planet PostgreSQL
SOLID Principles Explained: 5 Essential Principles for Writing Clean, Maintainable Code
0dev.to Tutorial
How to Build a Professional Resume in 2026: Best Resume Formats, Templates, and ATS Tips
0dev.to Career
How to Explain Your Project in a Technical Interview
0dev.to Career
Stop Calling It "Refactoring" When You Are Just Moving The Bugs Around
0dev.to Career