Tool-Assisted Agent on SQL Inspection and Refinement in Real-World Scenarios

Zhongyuan Wang, Richong Zhang, Zhijie Nie, Jaein Kim
8/30/2024
cs.CL

No confident code implementation found for this paper.

Abstract

Recent Text-to-SQL methods leverage large language models (LLMs) by incorporating feedback from the database management system. While these methods effectively address execution errors in SQL queries, they struggle with database mismatches -- errors that do not trigger execution exceptions.

Show full abstract

Database mismatches include issues such as condition mismatches and stricter constraint mismatches, both of which are more prevalent in real-world scenarios. To address these challenges, we propose a tool-assisted agent framework for SQL inspection and refinement, equipping the LLM-based agent with two specialized tools: a retriever and a detector, designed to diagnose and correct SQL queries with database mismatches. These tools enhance the capability of LLMs to handle real-world queries more effectively. We also introduce Spider-Mismatch, a new dataset specifically constructed to reflect the condition mismatch problems encountered in real-world scenarios. Experimental results demonstrate that our method achieves the highest performance on the averaged results of the Spider and Spider-Realistic datasets in few-shot settings, and it significantly outperforms baseline methods on the more realistic dataset, Spider-Mismatch.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wang2024toolassisted,
  title  = {Tool-Assisted Agent on SQL Inspection and Refinement in Real-World Scenarios},
  author = {Zhongyuan Wang and Richong Zhang and Zhijie Nie and Jaein Kim},
  year   = {2024},
  eprint = {2408.16991},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.16991v1}
}

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/2408.16991.svg)](https://codeofpaper.com/paper/2408.16991)

Discussion