Medication errors pose a significant threat to patient safety, making pharmacist verification (PV) a critical, yet heavily burdened, final safeguard. The direct application of Large Language Models (LLMs) to this zero-tolerance domain is untenable due to their inherent factual unreliability, lack of traceability, and weakness in complex reasoning. To address these challenges, we introduce PharmGraph-Auditor, a novel system designed for safe and evidence-grounded prescription auditing. The core of our system is a trustworthy Hybrid Pharmaceutical Knowledge Base (HPKB), implemented under the Virtual Knowledge Graph (VKG) paradigm. This architecture strategically unifies a relational component for set constraint satisfaction and a graph component for topological reasoning via a rigorous mapping layer. To construct this HPKB, we propose the Iterative Schema Refinement (ISR) algorithm, a framework that enables the co-evolution of both graph and relational schemas from medical texts. For auditing, we introduce the KB-grounded Chain of Verification (CoV), a new reasoning paradigm that transforms the LLM from an unreliable generator into a transparent reasoning engine. CoV decomposes the audit task into a sequence of verifiable queries against the HPKB, generating hybrid query plans to retrieve evidence from the most appropriate data store. Experimental results demonstrate robust knowledge extraction capabilities and show promises of using PharmGraph-Auditor to enable pharmacists to achieve safer and faster prescription verification.
Figures & tables
Figure 1. The workflow and the role of PharmGraph-Auditor.
Dimension
Relational ( R )
Graph ( G )
Data Nature
Atomic, Numerical, Conditional
Associative, Hierarchical, Transitive
Logic Type
Set Constraint Satisfaction
Topological Traversal
Access Cost
Index Scan: O(logN)
Index-free Adjacency: O(1)†
Complexity
Dependent on Dataset Size ( N )
Independent of Dataset Size ( N )
Typical Audit
Dosage Checks, Contraindications
Interactions, Allergies, Duplicate Therapy
† O(1) denotes constant time per relationship traversal, irrespective of ∣V∣ .
Table 1. The Knowledge Stratification Framework
Figure 2. System architecture of PharmGraph-Auditor.
Figure 3. The KB-grounded Chain of Verification (CoV) framework.
Figure 4. The Patient Profile-driven Evidence Selection Tree (P-EST) logic for pruning conflicting dosage rules.
Metric
Relational Data
Graph Relations
Total
# Documents
100
100
100
# Extracted Records
2,951
923
3,874
Avg. # Records / Doc
29.51
9.23
38.74
Table 2. Statistics of the Golden Standard HPKB
Method
Component
Precision
Recall
F1-score
PharmGraph-Auditor (Ours, GPT-4o)
Relational
0.7973
0.8243
0.8106
Graph
0.9565
0.9565
0.9565
Overall (Micro)
0.8260
0.8491
0.8374
PharmGraph-Auditor (Ours, Deepseek-V3)
Relational
0.7948
0.8378
0.8157
Graph
0.9782
0.9782
0.9782
Overall (Micro)
0.8235
0.8603
0.8415
Table 3. Performance on Knowledge Population Task
Figure 5. Types of prescription errors.
Method
Precision
Recall
F1-Score
Experience Review (Human)
100.0%
45.9%
62.9%
Rule Review (CDSS)
52.1%
67.6%
58.8%
Proposed Method (Ours)
74.3%
70.3%
72.2%
Table 4. Performance Comparison
Figure 6. Fine-grained performance analysis by risk category. The top chart illustrates Precision, and the bottom chart illustrates Recall.
Large Language Models (LLMs) are increasingly deployed in healthcare settings, yet their tendency to hallucinate poses risks when clinical decisions are involved. This study examine whether LLMs recommend recently banned or withdrawn pharmaceuticals when answering clinical questions and tests an agent-based method for reducing such errors. We developed a five-agent "Trust but Verify" system using a single LLM backbone. To measure regulatory knowledge obsolescence, we created an adversarial dataset of 103 clinical MCQs where historically correct answers now refer to banned substances. This scale ensures statistical significance across various therapeutic classes. We evaluated three open-access model families (GPT-OSS, Llama-3, Falcon-3) under vanilla and agentic conditions. Performance was measured via pointwise score, label accuracy, Hallucination Error Rate (HER), and Component Fidelity (CF) score. We also observed clinical safety regression in proprietary models. In default configurations, all models showed high hallucination rates, consistently selecting banned drugs that matched training data patterns. Our proposed agentic architecture reduced HER by approximately 53% across models. Pointwise scores shifted from -0.25 (unsafe recommendation) toward 0.0 (appropriate refusal). The safety audit intercepted dangerous outputs even when models' parametric knowledge favored the banned substance. The proposed multi-agent framework offers a model-agnostic method for enforcing regulatory compliance that prioritizes patient safety over fluent text generation. Our work demonstrates a practical approach for deploying autonomous AI systems in safety-critical healthcare settings. It shows how real-time regulatory data can be integrated into LLM pipelines to support clinical decision-making.
Muhammad Osama, Maheera Amjad, Zartasha Mustansar +2
Data Science and Machine Learning Lab, SINES, NUST · CEME, NUST
Medication recommendation predicts medications for patient visits, but existing methods still face two key challenges. At the model level, traditional drug recommendation methods only predict structured drug codes with limited evidence grounding, while LLM agents can use richer clinical context but may lack safety verification and traceability. At the task level, existing benchmarks often use broad medication categories, which ignore subgroup-level safety differences and can lead to risk overestimation. We introduce the first fine-grained medication recommendation setting based on fourth-level ATC code generation. We propose Safe Prescription Agent (SafeRx-Agent), a knowledge-grounded multi-agent framework that uses patient context, external clinical knowledge, and safety verification to recommend traceable medication sets. Experimental results on MIMIC-III and MIMIC-IV datasets show that SafeRx-Agent improves fine-grained medication prediction accuracy while controlling drug interactions, contraindications, and medication set size.
Xinyu Wang, Hanwei Wu, Zhenghan Tai +7
McGill University · McMaster University · University of Toronto +1
Retrieval-Augmented Generation (RAG) significantly improves the factuality of Large Language Models (LLMs), yet standard pipelines often lack mechanisms to verify inter- mediate reasoning, leaving them vulnerable to hallucinations in high-stakes domains. To address this, we propose a domain-specific RAG framework that integrates explicit rea- soning and faithfulness verification. Our architecture augments standard retrieval with neural query rewriting, BGE-based cross-encoder reranking, and a rationale generation module that grounds sub-claims in specific evidence spans. We further introduce an eight-category verification taxonomy that enables fine-grained assessment of rationale faithfulness, distinguishing between explicit and implicit support patterns to facilitate structured error diagnosis. We evaluate this framework on the BioASQ and PubMedQA benchmarks, specifically analyzing the impact of dynamic in-context learning and rerank- ing under constrained token budgets. Experiments demonstrate that explicit rationale generation improves accuracy over vanilla RAG baselines, while dynamic demonstration selection combined with robust reranking yields further gains in few-shot settings. Using Llama-3-8B-Instruct, our approach achieves 89.1% on BioASQ-Y/N and 73.0% on Pub- MedQA, competitive with systems using significantly larger models. Additionally, we perform a pilot study combining human expert assessment with LLM-based verification to explore how explicit rationale generation improves system transparency and enables more detailed diagnosis of retrieval failures in biomedical question answering.
Eeham Khan, Luis Rodriguez, Marc Queudot
Concordia University, Montréal, QC, Canada · Centre de recherche informatique de Montréal (CRIM), Montréal, QC, Canada