EEG-MedRAG: Enhancing EEG-based Clinical Decision-Making via Hierarchical Hypergraph Retrieval-Augmented Generation
Organizations: College of Information Science and Engineering, Northeastern University, Shenyang 110819, China · Institute of Automation, Chinese Academy of Sciences, Beijing, China · College of Computing and Data Science, Nanyang Technological University, Singapore · Squirrel Ai Learning, Bellevue, WA, USA
Abstract
With the widespread application of electroencephalography (EEG) in neuroscience and clinical practice, efficiently retrieving and semantically interpreting large-scale, multi-source, heterogeneous EEG data has become a pressing challenge. EEG-MedRAG addresses this challenge through a three-layer hypergraph-based retrieval-augmented generation framework that unifies EEG domain knowledge, individual patient cases, and large-scale EEG recordings into a traversable n-ary relational hypergraph, enabling joint semantic-temporal retrieval and evidence-grounded clinical reasoning. The accompanying benchmark is the first to pair EEG questions about the same clinical fact across five user roles. Its 700 questions span seven clinical domains and support direct comparisons of answer consistency across roles. Across three LLM backbones, EEG-MedRAG outperforms all four baselines in both overall answer correctness and token-level F1. It achieves up to 86.14% answer correctness on the full benchmark and 97.32% on non-EEG questions, with 97.41% evidence coverage on knowledge questions. In EEG retrieval, EEG-MedRAG improves top-five label agreement by 8.58 percentage points over the time-series baseline. The code is available at https://github.com/li-zan/EEG-MedRAG.
Figures & tables
| Question type | Questions | Families | Cases | Participants | Query EEG windows |
| Foundational knowledge | 140 | 28 | — | — | — |
| Case reasoning | 280 | 56 | 55 | 54 | — |
| EEG-linked | 140 | 28 | 26 | 26 | 28 |
| Knowledge application | 140 | 28 | 27 | 27 | — |
| Total | 700 | 140 | 97 | 87 | 28 |
| Method | Epilepsy | Parkinson’s disease | AD/FTD | Depression | Sleep deprivation | Mild TBI | First-episode psychosis | Overall | ||||||||
| AC | F1 | AC | F1 | AC | F1 | AC | F1 | AC | F1 | AC | F1 | AC | F1 | AC | F1 | |
| GPT-4o-mini | ||||||||||||||||
| NaiveGeneration | 70.00 | 47.13 | 59.00 | 39.68 | 73.00 | 44.15 | 78.00 | 42.34 | 67.00 | 41.62 | 71.00 | 38.42 | 77.00 | 39.31 | 70.71 | 41.81 |
| StandardRAG | 70.00 | 50.43 | 77.00 | 46.26 | 78.00 | 48.70 | 80.00 | 45.84 | 78.00 | 47.50 | 77.00 | 41.25 | 84.00 | 40.89 | 77.71 | 45.84 |
| HyperGraphRAG | 73.00 | 53.54 | 81.00 | 46.58 | 81.00 | 48.12 | 77.00 | 45.44 | 77.00 | 47.25 | 76.00 | 42.09 | 82.00 | 41.26 | 78.14 | 46.32 |
| TimeRAG | 76.00 | 51.74 | 55.00 | 39.51 | 73.00 | 45.46 | 79.00 | 41.56 | 65.00 | 43.44 | 70.00 | 39.49 | 77.00 | 38.20 | 70.71 | 42.77 |
| Method | EC (%) [95% CI] | CRel (%) [95% CI] | Mean tokens | Empty / 700 |
| StandardRAG | 78.75 [71.07, 85.89] | 14.48 [12.46, 16.33] | 3,799 | 225 |
| HyperGraphRAG | 94.73 [90.48, 98.10] | 13.52 [12.43, 14.51] | 17,378 | 81 |
| TimeRAG | 0.00 [0.00, 0.00] | 9.57 [6.15, 12.82] | 948 | 560 |
| EEG-MedRAG (ours) | 97.41 [93.81, 100.00] | 19.74 [18.56, 20.84] | 23,489 | 0 |
| Configuration | Foundational knowledge (140) | Knowledge application (140) | Case reasoning (280) | EEG- linked (140) | Overall (700) | AC (pp) [95% CI] | |||||
| AC | F1 | AC | F1 | AC | F1 | AC | F1 | AC | F1 | ||
| EEG-MedRAG (Full) | 99.29 | 59.43 | 96.43 | 34.84 | 96.79 | 62.18 | 29.29 | 20.25 | 83.71 | 47.78 | — |
| w/o Knowledge (KHG) | 78.57 | 41.06 | 75.71 | 26.25 | 98.21 | 65.96 | 20.00 | 21.17 | 74.14 | 44.08 | [ , ] |
| w/o Case (CHG) | 99.29 | 59.49 | 91.43 | 33.30 | 93.57 | 57.81 | 13.57 | 16.56 | 78.29 | 44.99 | [ , ] |
| w/o EEG (EVD) | 99.29 | 59.86 | 91.43 | 34.81 | 98.21 | 61.02 | 12.14 | 16.00 | 79.86 | 46.54 | [ , ] |
| Configuration | GPT-4o-mini | Gemini-2.5-Flash | DeepSeek-V4-Flash | Shared retrieval | |||||
| AC | F1 | AC | F1 | AC | F1 | EC (%) | CRel (%) | Tokens | |
| EEG-MedRAG (Full) | 83.71 | 47.78 | 86.14 | 43.28 | 81.29 † | 54.05 | 97.41 | 19.74 | 23,489 |
| Knowledge-only (KHG) | 78.29 | 44.29 | 79.57 | 41.07 | 70.57 † | 37.08 | 95.45 | 13.05 | 29,764 |
| Case-only (CHG) | 72.86 | 42.79 | 75.57 | 29.95 | 81.00 | 35.19 | 0.89 | 19.17 | 2,397 |
| EEG-only (EVD) | 70.71 | 42.18 | 77.00 | 25.61 | 81.00 | 34.83 | 0.00 | 8.44 | 591 |
| Method | Foundational knowledge (140) | Knowledge application (140) | Case reasoning (280) | EEG- linked (140) | ||||
| AC | F1 | AC | F1 | AC | F1 | AC | F1 | |
| GPT-4o-mini | ||||||||
| NaiveGeneration | 77.14 | 40.86 | 79.29 | 27.41 | 97.14 | 62.99 | 2.86 | 14.78 |
| StandardRAG | 95.00 | 56.63 | 89.29 | 34.82 | 95.71 | 62.04 | 12.86 | 13.67 |
| HyperGraphRAG | 98.57 | 60.95 | 92.14 | 34.13 | 92.86 | 61.33 | 14.29 | 13.87 |
| TimeRAG | 73.57 | 41.19 | 74.29 | 26.42 | 96.79 | 64.32 | 12.14 | 17.61 |
| Domain ( ) | EEG-MedRAG LA@5 (%) | TimeRAG LA@5 (%) | Random LA@5 (%) | EEG-MedRAG Random (pp) | Known-label neighbors (%) | Unique subj. / 5 |
| AD/FTD (4) | 60.00 | 30.00 | 34.94 | 100.0 | 2.75 | |
| Sleep deprivation (4) | 60.00 | 50.00 | 50.00 | 100.0 | 1.75 | |
| Mild TBI (4) | 60.00 | 55.00 | 50.00 | 100.0 | 2.00 | |
| Parkinson’s disease (4) | 55.00 | 50.00 | 50.00 | 100.0 | 2.25 | |
| First-episode psychosis (4) | 55.00 | 50.00 | 50.00 | 100.0 | 2.50 | |
| Epilepsy (4) | 50.00 | 50.00 | 50.00 | 100.0 | 3.50 |
| Backbone | Non-EEG AC (err / 560) | EEG-linked error share | EEG AC ( ) | EEG AC ( ) |
| GPT-4o-mini | 97.32% (15) | 86.8% (99 / 114) | 36.92% (24 / 65) | 22.67% (17 / 75) |
| Gemini-2.5-Flash | 97.14% (16) | 83.5% (81 / 97) | 64.62% (42 / 65) | 22.67% (17 / 75) |
| DeepSeek-V4-Flash | 90.89% † (51) | 61.1% (80 / 131) | 70.77% (46 / 65) | 18.67% (14 / 75) |
| Method | API req. | Local (s) | Input tokens | AC (%) | Errors |
| NaiveGeneration | 0.00 | — | 176 | 70.71 | 205 |
| StandardRAG | 1.00 | 0.06 | 4,116 | 77.71 | 156 |
| TimeRAG | 0.00 | 0.33 | 1,124 | 70.71 | 205 |
| HyperGraphRAG | 2.97 | 0.31 | 17,977 | 78.14 | 153 |
| EEG-MedRAG (ours) | 2.89 | 2.47 | 24,080 | 83.71 | 114 |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Study domain | OpenNeuro accession | Version | Retained channels |
| Epilepsy (SeizeIT2) | ds005873 | 1.1.0 | 2 |
| Depression | ds003478 | 1.1.0 | 64 |
| Parkinson’s disease | ds003509 | 1.1.0 | 63 |
| Alzheimer’s disease and frontotemporal dementia | ds004504 | 1.0.8 | 19 |
| Sleep deprivation | ds004902 | 1.0.8 | 61 |
| First-episode psychosis | ds003944 | 1.0.1 | 60 |
| Backbone | Baseline | AC (pp) | 95% CI ( AC) | F1 | 95% CI ( F1) |
| GPT-4o-mini | NaiveGeneration | [ , ] | [ , ] | ||
| StandardRAG | [ , ] | [ , ] | |||
| HyperGraphRAG | [ , ] | [ , ] | |||
| TimeRAG | [ , ] | [ , ] | |||
| Gemini-2.5-Flash | NaiveGeneration | [ , ] | [ , ] | ||
| StandardRAG | [ , ] | [ , ] |
| Stratum ( ) | StandardRAG | HyperGraphRAG | TimeRAG | EEG-MedRAG (ours) | ||||
| EC | CRel | EC | CRel | EC | CRel | EC | CRel | |
| By question type | ||||||||
| Foundational knowledge (140) | 84.29 | 21.49 | 99.29 | 17.65 | 0.00 | 0.00 | 100.00 | 17.41 |
| Case reasoning (280) | — | 4.78 | — | 9.06 | — | 0.00 | — | 16.92 |
| Knowledge application (140) | 73.21 | 23.87 | 90.18 | 19.29 | 0.00 | 0.00 | 94.82 | 27.08 |
| EEG-linked (140) | — | 17.47 | — | 12.53 | — | 47.84 | — | 20.39 |
| Method | Doctor | Researcher | Hospital intern | Nurse | Patient | |||||
| AC | F1 | AC | F1 | AC | F1 | AC | F1 | AC | F1 | |
| GPT-4o-mini | ||||||||||
| NaiveGeneration | 72.14 | 51.09 | 66.43 | 45.26 | 74.29 | 47.87 | 70.00 | 36.43 | 70.71 | 28.38 |
| StandardRAG | 80.71 | 55.29 | 80.71 | 50.74 | 77.14 | 52.16 | 72.86 | 39.32 | 77.14 | 31.70 |
| HyperGraphRAG | 80.00 | 54.71 | 77.86 | 52.14 | 78.57 | 53.18 | 77.14 | 38.42 | 77.14 | 33.17 |
| TimeRAG | 71.43 | 49.59 | 68.57 | 48.18 | 71.43 | 48.40 | 71.43 | 37.78 | 70.71 | 29.91 |
Clinical QA
Clinical question answering uses AI to answer medical and patient-specific questions from clinical knowledge, records, guidelines, and evidence.
See all 68 papers