Database agents need more than schema structure: business meanings, stored values and reference queries supply knowledge that becomes relevant at different points in reasoning. We introduce RubikSQL-HB, which exposes these materials through queryable, database-specific knowledge workspaces built on the HeavenBase platform. Its knowledge interface remains available as an agent constructs and investigates an answer. Candidate agents interleave knowledge access with SQL construction and execution; a downstream Judge can reuse the same interfaces to investigate disagreements. A two-stage example interface separates discovering a reference question from expanding its SQL. On a 500-question BIRD Mini-Dev evaluation, the full pipeline reaches 75.2% execution accuracy, against 71.2% for first-candidate selection and 70.4% for execution-majority voting, with a correct candidate available on 79.0% of questions. The raw-knowledge condition, which also regenerates candidates without the built workspace, is 3.0 points lower, and adjudication with tools and revision accounts for most of the gain over selection baselines. A recorded execution probe shows how continued investigation resolves a candidate disagreement. Separate archived runs show semantic revision recovering answers absent from their original candidate pools. A versioned development study further illustrates how recurring corrections become reusable execution checks. The system and results connect knowledge-interface design to agent decision quality: queryable knowledge supports the construction of useful alternatives, and evidence-aware adjudication connects those alternatives to a final answer. Keeping knowledge in the loop lets agents acquire relevant observations as their reasoning develops.
Figures & tables
Figure 2: Two-stage example retrieval. Discovery exposes only a session-local ID, question, and SQL character count; selected IDs resolve to retained question–SQL pairs in the same session and database. The agent chooses which reference SQL enters context. IDs and payloads are schematic. Candidate coverage and final accuracy under this interface are evaluated separately in Section 5.3 .
Knowledge and source
Reasoning use
Tables / columns: schema, documentation and profiles
Locate fields, inspect keys and interpret granularity
Values: selected categorical content
Match business expressions to stored literals
Examples: transferred training question–SQL pairs
Inspect reference query patterns
Synonyms: vocabulary-to-schema mappings
Connect user wording to canonical identifiers
Rules: prepared interpretation guidance
Check a proposed reading of the question
Table 1: Sources and uses of the six domain knowledge types. Database-level overview metadata is stored separately.
Figure 3: A recorded denominator dispute (development question Q00665, codebase_community ). All five candidates execute successfully; three return 104/6 and two return 104/12 . The Judge’s monthly-count probe exposes the six observed months; the question asks for a full-year average. Candidate 4 matches the reference. SQL excerpts share the join and filters; displayed values are rounded and schema is reconstructed. This qualitative execution-probe case is documented in Appendix A.1 .
Configuration
Description
Correct/500
EX (%)
Candidate-pool references (no Judge)
Oracle
At least one of five candidates correct
395
79.0
FIRST
Always select the first candidate
356
71.2
MV
Execution-result majority vote
352
70.4
Judge permissions and review (qwen3.8-max Judge)
J00-M
Selection only; no tools, no revision
358
71.6
Table 2: Main ablation on the 500-question evaluation cohort. Full-M (RG) is the primary configuration; other rows vary one permission, model, or knowledge-access factor at a time relative to it. Candidate-pool references and permission rows share one candidate generation; the knowledge-access rows (G0/G1/K0) regenerate their own pools per strategy.
Example strategy
Full EX (%)
G0: no examples
74.2
G1: one stage
74.8
G2: two stages
75.2
Table 3: Example-access comparison on the primary evaluation cohort. All entries are EX percentages under the primary configuration.
Judge
Tools / revision
EX (%)
J00-M
Off / Off
71.6
J01-M
Off / On
73.8
J10-M
On / Off
74.0
J11-M
On / On
74.6
Table 4: Fixed-pool Judge comparison before review, separating observation access from revision permission, on the primary evaluation cohort. J01 includes its recorded output fallback policy; see Appendix A.1 .
Figure 4: Paired permission effects in the two-repetition paired decision study (its own pools and scoring protocol; separate from the main ablation of Table 2 ). Points denote mean EX differences; whiskers are question-clustered 95% bootstrap intervals. The blue square isolates selection-only adjudication’s gain over majority; other rows test Full and additional permissions.
Judge
Original correct
Retest correct
J00
30/46
25/46
J01
17/46
29/46
J10
25/46
27/46
J11
21/46
25/46
Table 5: Targeted retest on historically discordant units, not a new full-cohort score. Each arm reuses the original five-candidate pool.
Review policy
EX (%)
No review (J11-M-R0)
74.6
Review all (J11-M-RA)
74.4
Risk-gated (Full-M)
75.2
Table 6: Reviewer effects on shared Judge outputs on the primary evaluation cohort. The gated view reuses the same review result on triggered questions and retains the Judge elsewhere.
Outcome
Decision
Retrieval G2
Correct candidate available
759
777
Covered, final correct
699
708
Covered, final incorrect
60
69
Uncovered, final incorrect
237
219
Uncovered, final correct
0
0
Table 7: Candidate-to-Full outcomes in the paired studies, totaled over scored question–repetition records per study. Counts are per-study pool statistics and are not comparable to the question-level totals of Table 2 .
Candidate arm
n
First
Majority
Judge
Rescues
qw3.6plus
497
385
386
397
6
qw3.7max
496
392
397
402
2
Table 8: Correct-answer counts in two archived fixed-pool runs. Rescues have no correct original candidate. Arm names follow the archive; these are separate historical configurations, not current main-result repetitions.
Figure 5: Fixed-pool candidate-count analysis in the paired retrieval study (its own pools and scoring; not the main-ablation scores of Table 2 ). Lines average every subset of size k and both repetitions. Shading shows the range across subset choices, not a confidence interval. Coverage increases much faster than execution-majority accuracy.
Figure 6: Candidate coverage and majority selection on an archived 500-question cohort, scored with the archive’s own ExD metric; these are not the main-ablation scores. Filled points show majority ExD; hollow points show Oracle. Mix-6 and Mix-10 reuse three or five candidates from each source model. The larger mixed pool has higher coverage and lower voting accuracy.
Figure 7: Mechanism interventions on 216 matched questions from an archived development cohort (E1: 159 correct). (a) Repairs, regressions, and net change. (b) Contrasts against the corresponding MCP-free controls, including solver or gate additions. Paired counts distinguish a mechanism’s corrections from the existing answers it changes.
Figure 8: M10 routing composites from an archived development cohort. The hollow circle is the exact backtest; squares repeat the 43 routed questions. All retain 455 E1 default answers. The repeated grain-branch gain coexists with variation in the temporal branch. Repetitions measure output stability on the fixed routed subset.
Figure 9: Evidence-guided development on the same 330 questions used for proposal development and version selection. (a) Agent and program responsibilities under human-set policies. (b) Accepted versions, annotated with the change and paired fixes/breaks. V1–V5 enable execution checks; V6 changes the Judge/Reviewer model. (c) Rejected proposals have both repairs and regressions; net losses compare each with its own parent. These development outcomes are separate from the 500-question main evaluation.
Table 9: Evaluation configuration. Requested seeds do not imply provider-guaranteed deterministic generation.
Paired contrast
Δ EX
95% interval
Full minus first
+0.50
[-1.10, +2.11]
Full minus majority
+0.70
[-0.50, +2.01]
Tools, selection only
-0.50
[-1.51, +0.50]
Tools, revision allowed
+0.40
[-0.80, +1.61]
Revision, tools off
-1.31
[-2.51, -0.10]
Revision, tools on
-0.40
[-1.41, +0.50]
Appendix
Table 10: Paired effects in the two-repetition paired decision study (its own pools and scoring protocol; separate from the main ablation). Differences are percentage points, with qid-clustered 95% intervals. Both repetitions move together when a question is resampled.
Database
A Full
B G0
B G1
B G2
California schools
41.67
45.00
45.00
41.67
Card games
67.65
69.61
69.61
69.61
Codebase community
80.21
82.29
79.17
78.12
Debit cards
70.00
75.00
73.33
71.67
European football
73.53
73.53
75.49
72.55
Financial
42.19
43.75
46.88
48.44
Appendix
Table 11: Mean Full EX by database. A is the decision cohort; B denotes retrieval G0/G1/G2. Each column averages its own two repetitions. A and B use separate generated candidate pools.
Archived view
n
First
Majority
Judge
Δ count
Candidate qw3.6plus
497
385
386
397
+11
Candidate qw3.7max
496
392
397
402
+5
E1
493
357
363
363
+0
J1 literal
495
364
364
368
+4
J2 votes3
495
364
364
361
-3
J3 literal+votes3
495
364
364
365
+1
Appendix
Table 12: Independently rescored archived views: common evaluable denominator and correct counts for first, majority and Judge. Official primary uses the pre-Reviewer answer. Configurations are separate saved runs, not exchangeable repetitions.
Version
Accepted change
Correct
Fix
Break
V0
Initial parent
257
—
—
V1
Consensus guard + submission gate
262
5
0
V2
Joined-count correction
265
3
0
V3
Selection normalization
267
2
0
V4
Entity-percentage count
269
2
0
V5
Strict added-table guard
270
1
0
Appendix
Table 13: Accepted development versions on 330 questions. Fix and break counts compare each version with its immediate parent.
Agentic Text-to-SQL systems can interact with users to clarify underspecified queries before generating SQL. However, a correct execution result does not necessarily imply that the agent has adequately resolved the underlying underspecification: the agent may silently make unverified assumptions that happen to match the intended answer. We show that this behavior is driven in part by premature clarification termination. Although forcing an agent to ask more questions improves execution accuracy, ambiguities are concentrated in earlier interactions, making brute-force questioning inefficient. More importantly, even when explicitly prompted to plan its clarification process, the agent frequently abandons questions that it has already identified as relevant. To address this failure mode, we introduce PlanPool, which externalizes the clarification plan as a mutable question pool. Every planned question must be explicitly asked or dropped before submission, while newly discovered ambiguities can be added during interaction. Across three benchmarks derived from BIRD-Interact and Spider, PlanPool consistently improves ambiguity coverage and reduces silent failures over unconstrained and prompt-based alternatives, while maintaining competitive execution accuracy. Our results highlight an important distinction in agentic reasoning: identifying missing information is not sufficient, and the agent must also reliably maintain and resolve it before committing to an answer.
Wen-Zhi Li, Yue Gong, Konstantinos Kanellis +1
Department of Computer Science Cornell University · Amazon Web Services
Text-to-SQL on complex schemas is unreliable on a single pass, so recent systems generate multiple SQL candidates and let voting filter out errors. Yet voting alone is not enough, because the multi-candidate recipe has three coupled weaknesses: 1) sampling more from a single generator produces increasingly redundant candidates, 2) existing pipelines apply one generic correction to every non-clean execution result, while runtime errors, timeouts, and empty results each indicate a different distance from correctness, and 3) existing selectors rely on a single angle such as result-majority voting or pairwise SQL comparison, missing what other angles would have caught. We present SIRIUS-SQL, which addresses all three weaknesses. A difficulty-smoothing RL recipe trains SIRIUS-32B to generate diverse executable SQL candidates, paired with a generalist LLM that fills in gaps left by the specialist. An execution-grounded lifecycle classifies each outcome and applies targeted repair before candidates re-enter the pool. A confidence-gated hybrid selector combines execution-result agreement with pairwise SQL-form judgment, escalating only near-tied cases to a deterministic structural check. SIRIUS-SQL reaches 75.88% on BIRD dev and 91.20% on SPIDER test. Two of three generalist pairings surpass Agentar-Scale-SQL, the strongest published multi-candidate system on BIRD dev.
Leo Luo, Haining Xie, Siqi Shen +8
TEG, Tencent Inc., China · 2Peking University, China
Text-to-SQL systems often struggle with deep contextual understanding, particularly for complex queries with subtle requirements. We present PV-SQL, an agentic framework that addresses these failures through two complementary components: Probe and Verify. The Probe component iteratively generates probing queries to retrieve concrete records from the database, resolving ambiguities in value formats, column semantics, and inter-table relationships to build richer contextual understanding. The Verify component employs a rule-based method to extract verifiable conditions and construct an executable checklist, enabling iterative SQL refinement that effectively reduces missing constraints. Experiments on the BIRD benchmarks show that PV-SQL outperforms the best text-to-SQL baseline by 5% in execution accuracy and 20.8% in valid efficiency score while consuming fewer tokens.