SQL-of-Thought: Multi-agentic Text-to-SQL with Guided Error Correction

Published: 22 Sept 2025, Last Modified: 25 Nov 2025DL4C @ NeurIPS 2025 PosterEveryoneRevisionsBibTeXCC BY 4.0
Keywords: Database, text2sql, nl2sql, multiagent, multi-agentic, agentic, chainofthought, sqlofthought, sql, aiforcode, mysql
TL;DR: SQL-of-Thought is a multi-agent NL2SQL framework that combines chain-of-thought planning with a taxonomy-guided correction loop, achieving state-of-the-art execution accuracy on Spider benchmarks.
Abstract: Converting natural language queries into SQL queries is a crucial challenge in both industry and academia, aiming to increase access to databases and large-scale applications. This work examines how in-context learning and chain-of-thought can be utilized to develop a robust solution for text-to-SQL systems. We propose SQL-of-Thought: a multi-agent framework that decomposes the Text2SQL task into schema linking, subproblem identification, query plan generation, SQL generation, and a guided correction loop. Unlike prior systems that rely only on execution-based static correction, we introduce taxonomy-guided dynamic error modification informed by in-context learning. SQL-of-Thought achieves 91.59% Execution Accuracy on the Spider dataset and similar state-of-the-art results on its variants, combining guided error taxonomy with reasoning-based query planning.
Submission Number: 53
Loading