A knowledge-guided agentic framework for mitigating patient-context ambiguity in health queries
Abstract
Patients often submit short, underspecified queries to healthcare chatbots that lack the patient-specific information needed to determine an appropriate response. Although these queries may be linguistically clear, they can support multiple plausible answers depending on undisclosed factors such as symptoms, diagnoses, medications, allergies, or dietary restrictions. A language model answering such a query directly may therefore rely on unsupported assumptions about the patient. We introduce a knowledge-guided agentic framework for mitigating patient-context ambiguity before final response generation. The framework operates between the patient and an otherwise unchanged downstream language model. It interprets the initial query, uses a task-specific knowledge graph to construct a set of plausible hypotheses, identifies the missing patient-context variables needed to distinguish among them, and asks targeted follow-up questions. The original query and the acquired context are then combined into a clarified prompt for the downstream model. We evaluated the framework across five language models using two controlled ambiguity-mitigation benchmarks: diagnosis retrieval from 1,034 symptom queries with clinically relevant evidence systematically masked, and dietary-safety classification from 487 queries with decisive health context omitted. The framework was compared with direct answering of the underspecified query and with rephrasing the same query without acquiring new patient information. In diagnosis retrieval, it increased overall exact Top-1 accuracy by at least 57.1 percentage points and selective exact Recall@5 by at least 77.7 percentage points across the five evaluated models compared with direct prompting. In dietary-safety classification, it improved accuracy across all five models and achieved the highest Matthews correlation coefficient for four...
Figures & tables
| Patient query | Patient-specific context | Implication for the response |
| What should I take for a headache? | Not provided | Several common options may appear plausible, but the information needed to distinguish among them is absent. |
| What should I take for a headache? | Pregnancy | The response must account for pregnancy-related medication constraints and may differ from general over-the-counter guidance. |
| What should I take for a headache? | Use of an anticoagulant | The response must consider medication interactions and bleeding risk before suggesting an option. |
| What should I take for a headache? | Liver disease | The response must consider whether common medications are appropriate given impaired liver function. |
| What should I take for a headache? | Multiple relevant conditions or warning signs | A specific medication recommendation may be inappropriate, and the response may instead require escalation or professional assessment. |
| Symptom-based diagnosis retrieval | Dietary safety classification | |
| Data source | Curated synthetic patient records | Curated food and health-condition resources |
| Evaluation instances | 1,034 | 487 |
| Output space | 32 diagnosis labels | OK or Not OK |
| Information initially provided | Partial symptom profile | Food-related question without complete health context |
| Information initially withheld | Approximately 49.5% of the symptoms recorded in the complete case | Patient-specific health conditions relevant to the queried food |
| Information initially visible | Approximately 50.5% of the symptoms recorded in the complete case | Queried food and the user’s stated request |
| Top-1, selective | Recall@5, selective | Top-1, overall | Recall@5, overall | |||||||||||
| Model | Configuration | Abstain | Category | ICD | Exact | Category | ICD | Exact | Category | ICD | Exact | Category | ICD | Exact |
| GPT-5.5 | Agent | 3.4 | 92.1 | 82.2 | 64.3 | 96.9 | 95.1 | 94.1 | 89.0 | 79.4 | 62.1 | 93.6 | 91.9 | 90.9 |
| GPT-5.5 | RaR | 0.0 | 80.3 | 27.5 | 1.7 | 95.6 | 60.5 | 2.2 | 80.3 | 27.5 | 1.7 | 95.6 | 60.5 | 2.2 |
| GPT-5.5 | Basic | 0.0 | 80.9 | 27.2 | 1.6 | 95.6 | 60.1 | 2.0 | 80.9 | 27.2 | 1.6 | 95.6 | 60.1 | 2.0 |
| Claude Opus 4.8 | Agent | 3.4 | 94.0 | 81.6 | 72.6 | 96.7 | 94.9 | 93.9 | 90.8 | 78.8 | 70.1 | 93.4 | 91.7 | 90.7 |
| Claude Opus 4.8 | RaR | 0.0 | 79.2 | 33.3 | 4.5 | 94.8 | 63.4 | 10.9 | 79.2 | 33.3 | 4.5 | 94.8 | 63.4 | 10.9 |
| Model | Configuration | Accuracy | MCC | F1 | Recall | Precision | FN rate | FP rate | FN ( ) |
| GPT-5.5 | Agent | 89.3 | 0.783 | 0.869 | 92.5 | 81.9 | 7.5 | 12.6 | 14 |
| GPT-5.5 | RaR | 83.2 | 0.640 | 0.747 | 65.1 | 87.7 | 34.9 | 5.6 | 65 |
| GPT-5.5 | Basic | 88.3 | 0.757 | 0.852 | 88.2 | 82.4 | 11.8 | 11.6 | 22 |
| Claude Opus 4.8 | Agent | 91.8 | 0.837 | 0.900 | 96.8 | 84.1 | 3.2 | 11.3 | 6 |
| Claude Opus 4.8 | RaR | 83.4 | 0.650 | 0.741 | 62.4 | 91.3 | 37.6 | 3.7 | 70 |
| Claude Opus 4.8 | Basic | 81.3 | 0.607 | 0.760 | 77.4 | 74.6 | 22.6 | 16.3 | 42 |
| Item 0: acute viral pharyngitis | Item 98: ischemic heart disease | ||||||
| Model | Configuration | ||||||
| GPT-5.5 | Agent | 1 | 0.000 | 0.000 | 1 | 0.000 | 0.000 |
| GPT-5.5 | RaR | 1 | 0.000 | 0.000 | 6 | 1.006 | 0.988 |
| GPT-5.5 | Basic | 1 | 0.000 | 0.000 | 5 | 1.232 | 1.128 |
| Claude Opus 4.8 | Agent | 1 | 0.000 | 0.000 | 2 | 0.335 | 0.000 |
| Claude Opus 4.8 | RaR | 11 | 2.092 | 0.000 | 9 | 2.044 | 0.511 |
| Classification over 1,000 repetitions | Predictive entropy (bits) | ||||||||
| Model | Configuration | Accuracy | MCC | Recall | Precision | FP rate | Mean | ||
| GPT-5.5 | Agent | 100.0 | 1.000 | 100.0 | 100.0 | 0.0 | 0.000 | 0.000 | 0.000 |
| GPT-5.5 | RaR | 96.8 | 0.938 | 93.6 | 100.0 | 0.0 | 0.343 | 0.000 | 0.172 |
| GPT-5.5 | Basic | 100.0 | 1.000 | 100.0 | 100.0 | 0.0 | 0.000 | 0.000 | 0.000 |
| Claude Opus 4.8 | Agent | 100.0 | 1.000 | 100.0 | 100.0 | 0.0 | 0.000 | 0.000 | 0.000 |
| Claude Opus 4.8 | RaR | 99.2 | 0.984 | 98.4 | 100.0 | 0.0 | 0.118 | 0.000 | 0.059 |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| Stage or partition | Patients | Instances |
| Generated by Synthea | 4,884 | – |
| Excluded: no retained benchmark instance | 366 | – |
| Included in the frozen benchmark | 4,518 | 10,374 |
| Training partition | 3,163 | 7,258 |
| Validation partition | 904 | 2,082 |
| Test partition | 451 | 1,034 |
| Component | Count |
| Diagnosis nodes | 129,815 |
| Symptom nodes | 340,842 |
| HAS_SYMPTOM relations | 82,813 |
| IS_A relations | 1,400 |
| Component | Count |
| USDA food-item nodes | 2,085,340 |
| Nutrient nodes | 477 |
| Food-phrase nodes | 298 |
| Ingredient nodes | 130 |
| Food-property nodes | 60 |
| Condition nodes | 67 |
| Display label | Developer | API provider | Requested identifier |
| GPT-5.5 | OpenAI | OpenAI | gpt-5.5 |
| Claude Opus 4.8 | Anthropic | Anthropic | claude-opus-4-8 |
| Gemini 3.1 Pro | OpenRouter | google/gemini-3.1-pro-preview | |
| Llama 3.3 70B Instruct | Meta | OpenRouter | meta-llama/llama-3.3-70b-instruct |
| Mistral Large | Mistral AI | Mistral | mistral-large-2512 |
| Mechanism | Seed (specific) | Surface after AIM | Latent |
| Severity masking | I’m feeling extremely anxious and having panic attacks for 2 weeks. I don’t know what to do. | I’m feeling anxious and having panic attacks for 2 weeks. I don’t know what to do. | full seed |
| Temporal masking | I’ve been depressed for 2 weeks . | I’ve been depressed for a while. | full seed |
| Euphemism mapping (risk-preserving vagueness) | I’ve been having thoughts of hurting myself . | I’ve been having thoughts. a | full seed |
| Diagnostic phrase removal | I was diagnosed with major depressive disorder . | I was diagnosed with. b | full seed |
| Ontological generalization (domain map + WordNet) | After masking: … and having panic attacks … | … and having mental condition … (domain hypernym map where applicable) | masked intermediate |
| LLM persona rewrite (illustrative) | (same seed as row 1, after rule-based steps) | “I’ve been kind of on edge and my body does that thing where it freaks out, it’s been going on for a bit.” | full seed + strategy tags |
| Mechanism | Seed (specific) | Surface after AIM | Latent |
| Disease/condition masking | Can I eat white rice with chicken curry? I have type 2 diabetes. | Can I eat white rice with chicken curry? | condition + safety label |
| Allergen masking | I need a recipe with 2 cups flour and chicken, but I have a peanut allergy. | I need a recipe with 2 cups flour and chicken, but. | allergen + full seed |
| Quantity removal | Add 2 cups of flour to the bowl. | Add some of flour to the bowl. | quantities + full seed |
| Ingredient omission | I need chicken, onions, and garlic for the stir-fry. | I need onions, and garlic for the stir-fry. (one ingredient dropped) | omitted slots + full seed |
| Generalization only | I want grilled salmon for dinner. | I want grilled fish for dinner. | full seed |
| LLM persona rewrite (illustrative) | (masked recipe-style request) | “I want to make that creamy spicy thing, maybe with some meat? I can’t remember what I bought.” | full seed + variables |
Medical QA
Medical question answering develops and evaluates AI systems that answer clinical, patient-facing, and health-information questions.
See all 84 papers