TL;DR
FlexSQL introduces a flexible, interactive approach to text-to-SQL tasks, allowing dynamic schema exploration, data inspection, and plan revision, leading to improved performance on complex database queries.
Contribution
The paper presents FlexSQL, a novel flexible agent that explores schemas, inspects data, and revises plans during reasoning, outperforming existing systems on challenging benchmarks.
Findings
FlexSQL achieves 65.4% on Spider2-Snow, surpassing strong baselines.
Flexible exploration and execution significantly improve query accuracy.
Integrating FlexSQL into coding agents yields over 10% improvement on Spider2-Snow.
Abstract
Text-to-SQL over large analytical databases requires navigating complex schemas, resolving ambiguous queries, and grounding decisions in actual data. Most current systems follow a fixed pipeline where schema elements are retrieved once upfront and the database is only revisited for post-hoc repair, limiting recovery from early mistakes. We present FlexSQL, a text-to-SQL agent whose core design principle is flexible database interaction: the agent can explore schema structure, inspect data values, and run verification queries at any point during reasoning. FlexSQL generates diverse execution plans to cover multiple query interpretations, implements each plan in either SQL or Python depending on the task, and uses a two-tiered repair mechanism that can backtrack from code-level errors to plan-level revisions. On Spider2-Snow, using gpt-oss-120b, FlexSQL achieves a 65.4\% score,…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
