Flexible database interaction throughout reasoning—exploring schemas and data on-demand rather than upfront—is more effective for text-to-SQL than fixed pipelines, even with smaller models.
FlexSQL is a text-to-SQL agent that can explore database schemas, inspect data, and run verification queries at any point during reasoning—rather than retrieving schema once upfront. It generates multiple execution plans, implements them in SQL or Python, and uses a two-tiered repair system to recover from mistakes.