{"slug": "nl2sql-with-iterative-self-refinement", "title": "NL2SQL with Iterative Self-Refinement", "summary": "A multi-agent, persona-driven NL2SQL framework achieved 90% correctness on 60 queries using Mistral across seven coordinated LLM calls, according to an arXiv paper (2610.22968v1). The framework combines domain relevance detection, schema-grounded knowledge construction, KPI-aware SQL synthesis, syntax-level self-repair using sqlite execution feedback, and semantic consistency checking via SQL-to-NL reverse engineering. The authors report the approach significantly reduces query hallucination and improves semantic fidelity over direct LLM prompting, targeting high-precision domains such as insurance where KPIs, regulatory constraints, and legacy relational systems are critical.", "body_md": "arXiv:2610.22968v1 Announce Type: cross \nAbstract: 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.", "url": "https://wpnews.pro/news/nl2sql-with-iterative-self-refinement", "canonical_source": "https://www.machinebrief.com/news/nl2sql-with-iterative-self-refinement-9d5l", "published_at": "2026-10-19 04:00:00+00:00", "updated_at": "2026-10-19 08:18:24.812688+00:00", "lang": "en", "topics": ["natural-language-processing", "large-language-models", "ai-agents", "ai-research", "ai-tools"], "entities": ["Mistral", "HuggingFace", "arXiv"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/nl2sql-with-iterative-self-refinement", "markdown": "https://wpnews.pro/news/nl2sql-with-iterative-self-refinement.md", "text": "https://wpnews.pro/news/nl2sql-with-iterative-self-refinement.txt", "jsonld": "https://wpnews.pro/news/nl2sql-with-iterative-self-refinement.jsonld"}}