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

Saumya Chaturvedi, Aman Chadha, Laurent Bindschaedler
8/30/2025
20 citations
cs.DBcs.LG

No official code found. Best implementation: shollercoaster/SQL-of-Thought (37 stars, Python, last commit 2025-12-18).

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.

Show full abstract

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 state-of-the-art results on the Spider dataset and its variants, combining guided error taxonomy with reasoning-based query planning.

View on arXivView PDF

Code Implementations(1)

Working code repository for the paper "SQL-of-Thought: Multi-agentic Text-to-SQL with Guided Error Correction"

377PythonAug 30, 202511 months ago

Similar Papers

Cite this paper

@article{chaturvedi2025sqlofthought,
  title  = {SQL-of-Thought: Multi-agentic Text-to-SQL with Guided Error Correction},
  author = {Saumya Chaturvedi and Aman Chadha and Laurent Bindschaedler},
  year   = {2025},
  eprint = {2509.00581},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2509.00581v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2509.00581.svg)](https://codeofpaper.com/paper/2509.00581)

Discussion