Why does my LLM agent run so many SQL queries for one question, and how do I cut them down?

Agents explore schemas and try partial queries before the final one, and more attempts do raise accuracy. In Supporting Our AI Overlords (CIDR 2026), more attempts raised success on the BIRD text-to-SQL benchmark by 14% to 70%, but across 50 attempts per task, distinct sub-plans were often under 10-20% of the total, so much of the work repeats. We recommend giving the agent grounding hints, such as which column holds the needed data; that cut queries by more than 20%.

Sources: Supporting Our AI Overlords: Redesigning Data Systems to be Agent-First (CIDR 2026)

More questions on this topic

All questions about using AI for data and knowledge work