SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.02815 · 2026

FlexSQL: Flexible Exploration and Execution Make Better Text-to-SQL Agents

Canwen Xu, Yang He, Ping Nie, Yuepeng Wang, Pham, Hieu Quang, S Davood, F Xi, Jocelyn Chen

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 13 functions out of this paper's own repositories and ran 10 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
StringNLPLAB/FlexSQL — 10 of 13
FunctionStatusWhere it lives
_get_table_overview_str Ran StringNLPLAB/FlexSQL/src/planning.py
pointer only (licence: NONE) · get_code("4ef61e098f5d60f5")
_parse_plan_candidates Ran StringNLPLAB/FlexSQL/src/planning.py
pointer only (licence: NONE) · get_code("0fc76891da04e4c3")
_revise_plans_with_invalid_tables Ran StringNLPLAB/FlexSQL/src/planning.py
pointer only (licence: NONE) · get_code("d410095619068f37")
check_json_structure Ran StringNLPLAB/FlexSQL/src/planning.py
pointer only (licence: NONE) · get_code("dad5543700af9460")
extract_all_blocks Ran StringNLPLAB/FlexSQL/src/planning.py
pointer only (licence: NONE) · get_code("41bd9ffcd8abc270")
extract_json_from_text Ran StringNLPLAB/FlexSQL/src/planning.py
pointer only (licence: NONE) · get_code("d4d75181a4cb0cfb")
get_db_id Ran StringNLPLAB/FlexSQL/src/planning.py
pointer only (licence: NONE) · get_code("a7f24773e28eaab3")
get_question_str Ran StringNLPLAB/FlexSQL/src/planning.py
pointer only (licence: NONE) · get_code("081caf427ea760f5")
load_table_similarities Ran StringNLPLAB/FlexSQL/src/planning.py
pointer only (licence: NONE) · get_code("db843b4aebb143e3")
match_table_name_flexible Ran StringNLPLAB/FlexSQL/src/planning.py
pointer only (licence: NONE) · get_code("bb85c39aaf8da193")
BaseChat Not yet run StringNLPLAB/FlexSQL/src/planning.py
pointer only (licence: NONE) · get_code("d776a01edd7a0dbe")
Chat Not yet run StringNLPLAB/FlexSQL/src/planning.py
pointer only (licence: NONE) · get_code("8bdf1845842d90ce")
planning_batch_generate Not yet run StringNLPLAB/FlexSQL/src/planning.py
pointer only (licence: NONE) · get_code("574b38a4223b9bc4")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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 textto-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, outperforming strong open-source baselines that use stronger, larger models such as gpt-o3 and DeepSeek-R1. When integrated into a generalpurpose coding agent (as skills in Claude Code), our approach yields over 10% relative improvement on Spider2-Snow. Further analysis shows that flexible exploration and flexible execution jointly contribute to the effectiveness of our approach, highlighting flexibility as a key design principle. Our code is available at: https://github.com/StringNLPLAB/FlexSQL.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2605.02815")
get_code_for_paper("2605.02815")
have("2605.02815")

Connect an agent — have() is free.