QueryGym: Step-by-Step Interaction with Relational Databases
Not on the map. Why?
Abstract (arXiv)
We introduce QueryGym, an interactive environment for building, testing, and evaluating LLM-based query planning agents. Existing frameworks often tie agents to specific query language dialects or obscure their reasoning; QueryGym instead requires agents to construct explicit sequences of relational algebra operations, ensuring engine-agnostic evaluation and transparent step-by-step planning. The environment is implemented as a Gymnasium interface that supplies observations -- including schema details, intermediate results, and execution feedback -- and receives actions that represent database exploration (e.g., previewing tables, sampling column values, retrieving unique values) as well as relational algebra operations (e.g., filter, project, join). We detail the motivation and the design of the environment. In the demo, we showcase the utility of the environment by contrasting it with contemporary LLMs that query databases. QueryGym serves as a practical testbed for research in error remediation, transparency, and reinforcement learning for query generation. For the associated demo, see https://ibm.biz/QueryGym.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 9 of its 14 references that are in the map. First posted on arXiv 25 Sep 2025.
Builds on
9 of 14 references.
References · 9
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 688
- 2017Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learningcited by 687
- 2023MAC-SQL: A Multi-Agent Collaborative Framework for Text-to-SQLcited by 164
- 2019SParC: Cross-Domain Semantic Parsing in Contextcited by 144
- 2024CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQLcited by 138
- 2020On the Potential of Lexico-logical Alignments for Semantic Parsing to SQL Queriescited by 60
- 2025Think2SQL: Reinforce LLM Reasoning Capabilities for Text2SQLcited by 14
- 2025RAISE: Reasoning Agent for Interactive SQL Explorationcited by 4
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2025Chain-of-Query: Unleashing the Power of LLMs in SQL-Aided Table Understanding via Multi-Agent Collaboration
- 2026GenDB: The Next Generation of Query Processing -- Synthesized, Not Engineered
- 2025AskDB: An LLM Agent for Natural Language Interaction with Relational Databases
- 2026Sophrosyne: Agentic Exploration of Relational Data Systems Needs Moderation
- 2025BAPPA: Benchmarking Agents, Plans, and Pipelines for Automated Text-to-SQL Generation
- 2025Toward Real-World Table Agents: Capabilities, Workflows, and Design Principles for LLM-based Table Intelligence
- 2025A Multi-agent Text2SQL Framework using Small Language Models and Execution Feedback
- 2025QUITE: A Query Rewrite System Beyond Rules with LLM Agents