Back to Publications
Under Review

HEAL: A Multi-Agent Framework with Disagreement-Gated Validation for Reliable Text-to-SQL on Clinical Patient Records

Fatema Tuj Johora Faria, Mukaffi Bin Moin, Md Mehedi Hasan Nipu, Khan Md Hasib, Md Rafiqul Islam, Asif Karim, Sami Azam

Under review at Expert Systems with Applications

July 2026 to Present

The Problem

A clinician asks a question in plain language, and a Text-to-SQL system returns a query that runs cleanly but selects the wrong patients. A term was mapped to the wrong column, or the wrong time window was assumed. Nothing crashes and nothing looks different, so the error goes unnoticed. Most systems only check the SQL after it is written, so a planning mistake survives all the way to a confident, wrong answer.

The Methodology

HEAL (Healthcare Execution-guided Multi-Agent for Logical queries) splits the task across agents that hand each other readable plans, and checks those plans before any SQL is written.

1
Plan

Decide what is asked (or ask back), resolve vague and time-based words, and choose the join path.

2
Validate

Check the plans against the live schema and against each other. Pass, re-plan once, or refuse.

3
Write and repair

Only a validated plan reaches SQL synthesis, then an auditor and an execution-guided refiner.

4
Explain

Explain the answer using only the rows that were actually returned.

HEAL methodology diagram
The HEAL pipeline (click to enlarge)
Results

Evaluated on SynClin-SQL, a benchmark of 500 clinician-style questions over a synthetic patient database. Exact Match, Execution Accuracy and Valid SQL are percentages. The human score is the mean of a four-point correctness rubric. Gains below are over the strongest baseline, chain-of-thought.

+12.0
points on GPT-4o-mini
+10.0
points on GPT-5 nano
+8.6
points on GPT-5 mini
Execution accuracy gain over the best baseline
Backbone Method Exact Match Execution Accuracy Valid SQL Human Score (1-4)
GPT-4o-miniZero-shot9.448.275.82.012
Few-shot11.851.677.42.174
CoT13.254.079.22.310
HEAL13.666.087.02.580
GPT-5 nanoZero-shot12.252.878.22.138
Few-shot15.257.480.22.334
CoT17.059.282.02.442
HEAL23.069.290.02.768
GPT-5 miniZero-shot14.056.281.02.254
Few-shot17.660.082.82.418
CoT19.862.684.62.538
HEAL29.071.292.62.808
Conclusion

HEAL improves execution accuracy on all three backbones, and the gain holds across ambiguity, join-path, temporal, and nested questions. Catching errors in the plan, before SQL exists, is what makes the difference. The trade-off is cost: about 8 model calls per query instead of one. Results come from one synthetic dataset, so validation on real clinical records is the next step.