Saved in:
Bibliographic Details
Main Authors: Ananthakrishnan, Haritha, Kokel, Harsha, Sikes, Kelsey, Bhattacharjya, Debarun, Katz, Michael, Sohrabi, Shirin, Srinivas, Kavitha
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2509.21674
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909985879883776
author Ananthakrishnan, Haritha
Kokel, Harsha
Sikes, Kelsey
Bhattacharjya, Debarun
Katz, Michael
Sohrabi, Shirin
Srinivas, Kavitha
author_facet Ananthakrishnan, Haritha
Kokel, Harsha
Sikes, Kelsey
Bhattacharjya, Debarun
Katz, Michael
Sohrabi, Shirin
Srinivas, Kavitha
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2509_21674
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle QueryGym: Step-by-Step Interaction with Relational Databases
Ananthakrishnan, Haritha
Kokel, Harsha
Sikes, Kelsey
Bhattacharjya, Debarun
Katz, Michael
Sohrabi, Shirin
Srinivas, Kavitha
Databases
Artificial Intelligence
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.
title QueryGym: Step-by-Step Interaction with Relational Databases
topic Databases
Artificial Intelligence
url https://arxiv.org/abs/2509.21674