AV-SQL: Decomposing Complex Text-to-SQL Queries with Agentic Views

📅 2026-04-08
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenge of accurately translating complex natural language queries into SQL over large databases, a task hindered by limited context length and difficulties in multi-table reasoning. The authors propose a multi-agent collaborative framework that decomposes text-to-SQL conversion into three stages: query rewriting, proxy view generation, and SQL synthesis. A key innovation is the introduction of a “proxy view” mechanism, wherein agents dynamically generate common table expressions (CTEs) to compress the database schema, encapsulate intermediate logical steps, and enable stepwise reasoning—thereby mitigating context constraints and schema-linking errors. The approach achieves a state-of-the-art execution accuracy of 70.38% on Spider 2.0 and demonstrates leading performance across multiple benchmarks, including Spider (85.59%), BIRD (72.16%), and KaggleDBQA (63.78%).
📝 Abstract
Text-to-SQL is the task of translating natural language queries into executable SQL for a given database, enabling non-expert users to access structured data without writing SQL manually. Despite rapid advances driven by large language models (LLMs), existing approaches still struggle with complex queries in real-world settings, where database schemas are large and questions require multi-step reasoning over many interrelated tables. In such cases, providing the full schema often exceeds the context window, while one-shot generation frequently produces non-executable SQL due to syntax errors and incorrect schema linking. To address these challenges, we introduce AV-SQL, a framework that decomposes complex Text-to-SQL into a pipeline of specialized LLM agents. Central to AV-SQL is the concept of agentic views: agent-generated Common Table Expressions (CTEs) that encapsulate intermediate query logic and filter relevant schema elements from large schemas. AV-SQL operates in three stages: (1) a rewriter agent compresses and clarifies the input query; (2) a view generator agent processes schema chunks to produce agentic views; and (3) a planner, generator, and revisor agent collaboratively compose these views into the final SQL query. Extensive experiments show that AV-SQL achieves 70.38% execution accuracy on the challenging Spider 2.0 benchmark, outperforming state-of-the-art baselines, while remaining competitive on standard datasets with 85.59% on Spider, 72.16% on BIRD and 63.78% on KaggleDBQA. Our source code is available at https://github.com/pminhtam/AV-SQL.
Problem

Research questions and friction points this paper is trying to address.

Text-to-SQL
complex queries
large database schemas
multi-step reasoning
schema linking
Innovation

Methods, ideas, or system contributions that make the work stand out.

Agentic Views
Text-to-SQL
Common Table Expressions
Multi-agent Framework
Schema Decomposition
🔎 Similar Papers
M
Minh Tam Pham
Griffith University (Australia)
T
Trinh Pham
Griffith University (Australia)
T
Tong Chen
The University of Queensland (Australia)
Hongzhi Yin
Hongzhi Yin
Professor and ARC Future Fellow, University of Queensland
Recommender SystemGraph LearningSpatial-temporal PredictionEdge IntelligenceLLM
Q
Quoc Viet Hung Nguyen
Griffith University (Australia)
Thanh Tam Nguyen
Thanh Tam Nguyen
Lecturer, Griffith University
Social Network MiningStream ProcessingBig DataPrivacy-Preserving MLRecommender Systems