TRANSMISSION // 2611.32772v1
Why SQL agents need knowledge while they work
Source published
RubikSQL-HB lets database agents consult documentation, stored values and example queries while constructing and assessing SQL. On a 500-question development benchmark, its full pipeline scored higher than simple selection approaches, though the study has important limits.

Turning a plain-language question into SQL takes more than recognizing table names. RubikSQL-HB is designed to let AI agents consult database-specific knowledge while they build, run and assess queries.
A database can contain the right answer and still be difficult to question. Its tables and columns describe structure, but not necessarily what a business term means, which stored value represents it, or what a useful query should look like. RubikSQL-HB, described in an arXiv preprint, lets AI agents look up these clues as they work—not just receive them once at the start.
The system organizes database-specific information in a persistent workspace: schema descriptions, profiles of stored values, synonyms, interpretation rules and example question–SQL pairs. A candidate agent can consult these resources, write SQL, run it against the target database and use the result to guide further investigation. For examples, the interface first offers a menu of reference questions; the agent can choose which full SQL examples to inspect.
Several agents can independently propose queries. A downstream “Judge” receives their SQL and summaries of their results. It can consult the same knowledge resources, run additional targeted queries, select a candidate or write revised SQL. An optional Reviewer can inspect selected answers. The central idea is to keep both background knowledge and live database observations available as the system’s information needs change.
Testing the system
The authors evaluated RubikSQL-HB on 500 questions from BIRD Mini-Dev, a development benchmark covering 11 databases. Five candidate slots were used for each question. Candidates used qwen3.7-plus; in the primary configuration, the Judge used qwen3.8-max and the Reviewer followed the Judge model. The researchers compared configurations that changed the Judge’s permissions, the example-retrieval interface and other aspects of the pipeline.
The main measure was execution accuracy: whether a query’s result matched the reference answer’s result on the database. The full configuration reached 75.2%. In the main ablation, always choosing the first candidate reached 71.2%, while choosing the largest group of candidates with matching execution results reached 70.4%. At least one candidate was correct on 79.0% of questions. That last figure indicates how often the candidate pool contained a correct answer; it does not mean the Judge could necessarily identify it.
Within that main ablation, the Judge with tools and permission to revise queries scored 74.6%, compared with 71.6% for a Judge restricted to choosing an existing candidate. These figures use the candidate generation shared by the permission comparisons. A separate “raw knowledge” condition scored 72.2%, 3.0 percentage points below the full configuration. However, it regenerated candidates as well as changing the knowledge setup, so this comparison does not isolate the effect of the workspace alone.
One recorded example shows candidates disagreeing about an average. The Judge queried the database and found six observed months; the question asked for a full-year average. The Judge selected the correct minority candidate. The paper says this dispute was resolved through execution evidence, not stored workspace records. A different, separately archived run illustrates a Judge correcting a denominator error shared by all five candidates. That historical case is not part of the main evaluation, and neither example proves that investigation or revision caused the overall score difference.
What the results do—and don’t—show
Results for the two-stage example interface were close: 75.2% for the full setup, 74.8% when examples were retrieved in one stage, and 74.2% with example access disabled. The authors caution that gaps of one percentage point or less represent only a few questions in this 500-question evaluation, and do not treat the small differences as a stable ranking. Other paired analyses use separate candidate pools and scoring procedures; their figures should not be conflated with the main results.
The benchmark is a development subset that influenced system development, rather than an untouched test of performance on new questions. Execution accuracy measures agreement on a particular database instance: different queries can produce the same result there while expressing different meanings. The authors also note that stored profiles and rules can be wrong, and that their individual accuracy effects were not measured. Other datasets and SQL dialects, efficiency, production reliability and security were outside this answer-quality evaluation.
The paper also describes checks developed across system versions on a separate fixed set of 330 questions. The correct count rose from 257 to 270, with the net gain attributed to narrowly targeted execution checks in the recorded sequence. Because the questions were used to develop and select those changes, the increase is not an estimate of improvement on unseen data.
RubikSQL-HB is best understood as a design and evaluation study: it examines how queryable knowledge, live database probes and evidence-aware selection can fit into one workflow. The work is an arXiv preprint, not a peer-reviewed publication. Its findings describe this system in the tested setting and do not establish how reliably database agents will answer business questions in everyday use.
- text-to-SQL
- AI agents
- database knowledge
- BIRD Mini-Dev
- SQL execution accuracy
- large language models
Reviewed cross-references
These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.
A two-stage check for AI-generated database queries
Shared method: Both systems include a post-generation stage that can refine SQL: RubikSQL-HB’s Judge may investigate disagreements and revise a query, while VCoT-SQL’s Validator diagnoses and corrects generated SQL. Their mechanisms differ—tool-assisted adjudication versus a trained validator—and the reported evaluations use different settings, so this connection is about pipeline design, not comparative effectiveness.
Model review: · openai-codex/gpt-6-luna
Evidence and provenance
Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.
2611.32772v1 — Original paper
Excerpt reference:
static/papers/2611.32772v1.md:130-177
Basis: Paper text
Source SHA-256:5069cec1cbda5731c625aec00635ceb0e623c42ea77f93075a97eecec14a7abb2611.00815v1 — Original paper
Excerpt reference:
static/papers/2611.00815v1.md:80-155
Basis: Paper text
Source SHA-256:e0285c457ca253c6132c0b0e86f716547853ab70372c85cc100d82997a16b0a8
Related reading
Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.
When Should a Text-to-SQL System Abstain?
Source published
Shared keywords: large language models, text to sql
Helping AI Keep More Than One Database Interpretation in Play
Source published
Shared keywords: large language models, text to sql
When an AI Queries a Database, How Does It Know What You Mean?
Source published
Shared keywords: large language models, text to sql
Physicians preferred conversational database queries, but accuracy remained a concern
Source published
Shared keywords: large language models, text to sql
Can a local AI team help utilities question their smart-meter data?
Source published
Shared keywords: text to sql