Advancing Feature Extraction in Healthcare through the Integration of Knowledge Graphs and Large Language Models

Fahmida Liza Piya, Rahmatollah Beheshti

Abstract

Modern healthcare systems generate vast quantities of data, yet much of the clinical insight remains trapped in unstructured formats within Electronic Health Records (EHRs). This paper presents a hybrid AI framework designed to extract high-quality clinical features by combining the structural precision of Knowledge Graphs (KGs) with the contextual reasoning capabilities of Large Language Models (LLMs). Utilizing a Retrieval-Augmented Generation (RAG) architecture, the system grounds LLM outputs in a domain-specific "source of truth," mitigating common issues such as hallucinations and loss of context. Preliminary results demonstrate that this integrated approach enhances Named Entity Recognition (NER) and provides a scalable, disease-agnostic solution for clinical decision support.

Introduction

Electronic Health Records (EHRs) are a cornerstone of modern medicine, containing critical data points ranging from demographics to complex clinical narratives. However, the most valuable insights—such as those found in discharge summaries and clinical notes—are often "trapped" in unstructured text. Traditional Natural Language Processing (NLP) techniques frequently struggle with the inherent noise, ambiguity, and heterogeneity of medical language.

While Large Language Models (LLMs) have recently demonstrated remarkable potential in understanding clinical text, they are not without significant flaws in a medical context. Specifically, LLMs often lack deep, domain-specific expertise and are prone to "hallucinations," where the model generates plausible-sounding but factually incorrect information. Conversely, Knowledge Graphs (KGs) offer a robust, structured representation of clinical relationships but lack the flexible reasoning and linguistic nuance of LLMs. This research proposes a synergistic framework that bridges this gap, using KGs to ground LLM reasoning for more accurate feature extraction.

Methodology

The proposed framework is built upon three primary pillars designed to transform raw EHR data into actionable clinical insights.

1. Knowledge Graph Construction

Using the Neo4j graph database, the researchers constructed a domain-specific KG designed to map the "patient journey." In this model, nodes represent distinct clinical entities—including patients, hospital admissions, diagnoses, and prescriptions—while edges represent the temporal and clinical relationships between them. This structure allows the system to maintain a longitudinal view of a patient's medical history, providing a relational context that flat databases cannot achieve.

2. LLM-Based Entity Extraction

Rather than relying on rigid, rule-based NLP systems, the framework employs LLMs to perform Named Entity Recognition (NER). The LLM is tasked with identifying key clinical features from unstructured text. By leveraging the broad linguistic training of the LLM, the system can interpret varied medical terminology and shorthand that often stymies traditional models.

3. RAG Integration

The "connective tissue" of the framework is a Retrieval-Augmented Generation (RAG) pipeline. When the LLM processes a clinical note, the system retrieves relevant structured context from the Neo4j KG. This retrieved data acts as a factual anchor, guiding the LLM's extraction process. By providing the model with the patient's known history and relevant clinical relationships, the RAG pipeline ensures that the extracted features are both clinically relevant and factually grounded.

Data and Implementation

The study utilizes a comprehensive clinical dataset focusing on core tables such as patient demographics, hospital admissions, diagnoses, procedures, and prescriptions. These tables serve as the foundation for the patient journey within the Neo4j environment. The framework is designed to be disease-agnostic; unlike many medical AI tools tailored for specific conditions like diabetes or oncology, this system focuses on the underlying structure of clinical data, making it applicable across diverse medical specialties.

Preliminary Results and Insights

As of late 2024, the research has reached several key milestones:

  • Pipeline Implementation: The authors have successfully completed the initial entity extraction model and the preliminary Knowledge Graph structure.
  • Enhanced Performance: Preliminary testing indicates that integrating the KG with LLMs significantly enhances NER tasks compared to using LLMs in isolation. The KG provides the "organizational strength" that prevents the LLM from losing context during complex extractions.
  • Relational Context: A core insight of the work is that clinical data is inherently relational and temporal. Modeling history as a graph allows the AI to better understand the context of new clinical notes by situating them within the broader patient journey.

Limitations and Future Work

While the initial results are promising, the research is ongoing. The authors have identified several critical areas for future development:

  • Feedback Loops: Implementing mechanisms where domain-specific expert knowledge can further refine the accuracy of the entity extraction process.
  • Generalization: Validating the system on diverse, unseen datasets from different hospital systems to ensure the framework's robustness.
  • Predictive Modeling: The ultimate objective is to transition from data extraction to predictive analytics. By February 2025, the researchers aim to use the enriched KG to evaluate disease progression and predict patient outcomes.

Conclusion

The integration of Knowledge Graphs and Large Language Models represents a significant step forward in clinical data processing. By combining the structural reliability of KGs with the reasoning power of LLMs, this framework offers a path toward unlocking the full potential of EHRs, ultimately improving medical decision-making and patient care.

Summary updated

Abstract

The exponential growth of unstructured medical data presents a unique opportunity and challenge for advancing healthcare. Traditional methods struggle to extract meaningful insights from this complex data due to its inherent noise, ambiguity, and heterogeneity. To address these limitations, we propose a novel hybrid approach that integrates Knowledge Graphs (KGs) with Large Language Models (LLMs) within a Retrieval-Augmented Generation (RAG) framework. By leveraging the structured knowledge of KGs and the contextual understanding of LLMs, we aim to improve the precision of feature extraction and disease progression modeling. Our research focuses on refining the KG representation through advanced entity extraction and relation extraction techniques, ensuring that the KG accurately captures the semantic nuances and temporal dynamics of medical data. By integrating this enhanced KG with the RAG framework, we can derive more precise and informative insights for clinical decision-making.
BibTeX
@inproceedings{piya2025advancing,
  author = {Fahmida Liza Piya and Rahmatollah Beheshti},
  title = {{Advancing Feature Extraction in Healthcare through the Integration of Knowledge Graphs and Large Language Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i28.35224},
}
Figure