TL;DR
FHIR-Hopper is a neuro-symbolic agentic framework designed to help Large Language Models (LLMs) reason over complex, multi-relational Electronic Health Records (EHRs). By projecting raw data into an episodic chronological graph and providing the LLM with deterministic traversal tools, it achieves state-of-the-art accuracy while reducing token usage by up to 10× compared to traditional retrieval methods.
What Problem Does This Paper Address?
The healthcare industry has largely converged on the FHIR (Fast Healthcare Interoperability Resources) standard for exchanging patient data. While FHIR is great for interoperability, it is a nightmare for LLMs. Patient histories are stored as "bundles" of deeply nested JSON objects connected by complex cross-references (UUIDs).
When researchers try to feed these records into LLMs, they hit two major walls:
- Context Overflow: FHIR data is incredibly verbose. Flattening these records into text creates massive "boilerplate" metadata that drowns out clinical signals and triggers the "lost in the middle" phenomenon where LLMs ignore information in long contexts.
- Structural Fragmentation: Sequential text processing destroys the graph-like nature of clinical data. An LLM might see a "Condition" at the beginning of a document and its related "Encounter" thousands of tokens later, making it nearly impossible to maintain a coherent reasoning chain across scattered identifiers.
Methods
The authors introduce FHIR-Hopper, which shifts the paradigm from "read the whole file" to "navigate the graph." The framework operates in three stages:
- Episodic Graph Projection: Instead of a flat list, FHIR-Hopper transforms the record into a chronological graph. It uses an "episodic spine," where clinical events are grouped into "episode nodes" (encounters). If a resource lacks an explicit link, the system uses "latent episode inference" to snap it to the nearest logical timeframe.
- Saliency-Budgeted Linearization (SBL): Since the full graph is often too big for a prompt, the system creates a "skeleton" view. It ranks resources by relevance to the user's query and fits the highest-signal snippets into a strict token budget (set at a tiny 4,000 tokens for testing). This skeleton acts as the LLM's initial map.
- Graph-Constrained Agentic Reasoning: The LLM acts as a "Clinical Graph Navigator." It is given four deterministic tools to interact with the "hidden" parts of the graph:
inspect_node: Fetch the full JSON for a specific resource.search_graph: Perform a semantic search for keywords in pruned nodes.follow_links: Traverse relational edges (e.g., from a medication to the condition it treats).filter_time: Scope nodes by specific date ranges.
This neuro-symbolic approach delegates the "boring" work of looking up IDs and filtering dates to a symbolic engine, freeing the LLM to focus on high-level clinical reasoning.
Datasets
The framework was evaluated on three benchmarks of increasing complexity:
- EHRQA: 5,133 synthetic QA pairs used to test basic single- and two-hop retrieval.
- MedAgentBench: 148 clinician-authored tasks involving 100 de-identified patient profiles with over 700,000 data elements.
- FHIR-AgentBench: 2,931 clinician-sourced questions based on the MIMIC-IV-FHIR dataset, requiring complex multi-hop and temporal reasoning.
Key Insights and Ideas
- Stable Token Footprint: Unlike standard RAG or "long-context" approaches where token usage grows linearly with the size of the patient record ($O(N)$), FHIR-Hopper maintains a stable $O(1)$ footprint. It consistently uses ~20k tokens regardless of whether the record contains 100 or 10,000 resources.
- Structure Trumps Embeddings: The authors found that FHIR-Hopper’s superiority comes from its structural representation, not just better search. Even when compared to baselines using the exact same embedding model, the graph-traversal approach was significantly more accurate.
- The "Skeleton" Strategy: By providing a lossy but high-signal initial context, the model avoids being overwhelmed while still having the "tools" to find missing details on demand.
- Auditability: Because the agent must explicitly call tools to find evidence, it produces a deterministic trace of its reasoning path. This is a massive win for clinical safety and trust compared to "black-box" LLM responses.
Key Results
FHIR-Hopper demonstrated Pareto dominance—achieving the highest accuracy at the lowest cost—on complex, real-world benchmarks.
- Accuracy: On the difficult FHIR-AgentBench, FHIR-Hopper (using Claude Sonnet 4.6) reached 0.611, significantly outperforming all baselines. On MedAgentBench, it achieved a dominant 0.959.
- Efficiency: On long records, FHIR-Hopper reduced input-token usage by approximately 10× compared to the strongest retrieval baseline (Ontology-guided) and up to 30× compared to simple JSON-to-text flattening.
- Scalability: While baselines frequently triggered context overflows on massive records, FHIR-Hopper remained stable, making it viable for patients with decades of medical history.
Limitations and Future Work
- Latency: The multi-turn tool-calling loop is slower than a single-shot prompt. FHIR-Hopper takes 30–60 seconds per query, whereas non-agentic approaches take about 10 seconds.
- Reference Integrity: The system relies on the quality of FHIR references. If the underlying data has broken or missing links, the agent’s ability to "hop" through the graph is degraded.
- Multimodality: The current version focuses on structured data. The authors suggest that future work could integrate dedicated encoders for unstructured clinical notes and medical imaging as nodes within the graph.
- Dynamic Budgeting: The token budget ($\beta$) is currently fixed; the authors propose that adapting this budget based on the estimated difficulty of the question could further optimize performance.
Summary updated