Table of Contents
Fetching ...

MedBeads: An Agent-Native, Immutable Data Substrate for Trustworthy Medical AI

Takahito Nakajima

TL;DR

MedBeads introduces an agent-native, immutable data substrate that replaces human-centered EMR data with a Merkle DAG of Beads to provide deterministic, tamper-evident context for medical AI. By turning FHIR-derived events into causally linked Beads and enabling BFS-based context retrieval, the approach eliminates reliance on probabilistic RAG and mitigates AI hallucination while preserving auditability. The architecture combines a Go core for storage and traversal, Python middleware for FHIR conversion and LLM integration, and a React UI for explainable visualization, all open-sourced to accelerate adoption. The framework promises a path toward trustworthy, auditable medical AI by enforcing explicit causality, cryptographic provenance, and model-agnostic reasoning, with future work focusing on broader evaluation and standardization within MCP ecosystems.

Abstract

Background: As of 2026, Large Language Models (LLMs) demonstrate expert-level medical knowledge. However, deploying them as autonomous "Clinical Agents" remains limited. Current Electronic Medical Records (EMRs) and standards like FHIR are designed for human review, creating a "Context Mismatch": AI agents receive fragmented data and must rely on probabilistic inference (e.g., RAG) to reconstruct patient history. This approach causes hallucinations and hinders auditability. Methods: We propose MedBeads, an agent-native data infrastructure where clinical events are immutable "Beads"--nodes in a Merkle Directed Acyclic Graph (DAG)--cryptographically referencing causal predecessors. This "write-once, read-many" architecture makes tampering mathematically detectable. We implemented a prototype with a Go Core Engine, Python middleware for LLM integration, and a React-based visualization interface. Results: We successfully implemented the workflow using synthetic data. The FHIR-to-DAG conversion transformed flat resources into a causally-linked graph. Our Breadth-First Search (BFS) Context Retrieval algorithm traverses relevant subgraphs with O(V+E) complexity, enabling real-time decision support. Tamper-evidence is guaranteed by design: any modification breaks the cryptographic chain. The visualization aids clinician understanding through explicit causal links. Conclusion: MedBeads addresses the "Context Mismatch" by shifting from probabilistic search to deterministic graph traversal, and from mutable records to immutable chains, providing the substrate for "Trustworthy Medical AI." It guarantees the context the AI receives is deterministic and tamper-evident, while the LLM determines interpretation. The structured Bead format serves as a token-efficient "AI-native language." We release MedBeads as open-source software to accelerate agent-native data standards.

MedBeads: An Agent-Native, Immutable Data Substrate for Trustworthy Medical AI

TL;DR

MedBeads introduces an agent-native, immutable data substrate that replaces human-centered EMR data with a Merkle DAG of Beads to provide deterministic, tamper-evident context for medical AI. By turning FHIR-derived events into causally linked Beads and enabling BFS-based context retrieval, the approach eliminates reliance on probabilistic RAG and mitigates AI hallucination while preserving auditability. The architecture combines a Go core for storage and traversal, Python middleware for FHIR conversion and LLM integration, and a React UI for explainable visualization, all open-sourced to accelerate adoption. The framework promises a path toward trustworthy, auditable medical AI by enforcing explicit causality, cryptographic provenance, and model-agnostic reasoning, with future work focusing on broader evaluation and standardization within MCP ecosystems.

Abstract

Background: As of 2026, Large Language Models (LLMs) demonstrate expert-level medical knowledge. However, deploying them as autonomous "Clinical Agents" remains limited. Current Electronic Medical Records (EMRs) and standards like FHIR are designed for human review, creating a "Context Mismatch": AI agents receive fragmented data and must rely on probabilistic inference (e.g., RAG) to reconstruct patient history. This approach causes hallucinations and hinders auditability. Methods: We propose MedBeads, an agent-native data infrastructure where clinical events are immutable "Beads"--nodes in a Merkle Directed Acyclic Graph (DAG)--cryptographically referencing causal predecessors. This "write-once, read-many" architecture makes tampering mathematically detectable. We implemented a prototype with a Go Core Engine, Python middleware for LLM integration, and a React-based visualization interface. Results: We successfully implemented the workflow using synthetic data. The FHIR-to-DAG conversion transformed flat resources into a causally-linked graph. Our Breadth-First Search (BFS) Context Retrieval algorithm traverses relevant subgraphs with O(V+E) complexity, enabling real-time decision support. Tamper-evidence is guaranteed by design: any modification breaks the cryptographic chain. The visualization aids clinician understanding through explicit causal links. Conclusion: MedBeads addresses the "Context Mismatch" by shifting from probabilistic search to deterministic graph traversal, and from mutable records to immutable chains, providing the substrate for "Trustworthy Medical AI." It guarantees the context the AI receives is deterministic and tamper-evident, while the LLM determines interpretation. The structured Bead format serves as a token-efficient "AI-native language." We release MedBeads as open-source software to accelerate agent-native data standards.
Paper Structure (60 sections, 2 equations, 5 figures, 4 tables)

This paper contains 60 sections, 2 equations, 5 figures, 4 tables.

Figures (5)

  • Figure 1: The Context Mismatch visualized. (Left) FHIR's resource-based model with relational references requires complex querying and provides no inherent causality. (Right) MedBeads' Merkle DAG model embeds temporal and causal context directly into the data structure, creating an immutable, AI-traversable history.
  • Figure 2: MedBeads System Architecture. The system consists of three layers: The React Frontend (visualizer), the Python Intelligence Layer (handling FHIR conversion and LLM reasoning), and the Go Core Engine (managing CAS storage and graph traversal). Data flows from standard FHIR sources into an immutable Merkle DAG, which is then deterministically retrieved for AI consumption.
  • Figure 3: Security Clearance Mechanism. Access rules are embedded within each Bead, allowing role-based filtering (e.g., restricting Insurance access while allowing Specialist access) that is cryptographically tamper-evident.
  • Figure 4: Dual Timeline Views in MedBeads. (A) List View: A chronological display of clinical events with color-coded icons representing different Bead categories (encounters, observations, conditions, medications, and procedures), enabling rapid scanning of patient history. (B) Graph View: A DAG visualization where each Bead is rendered as a node with edges explicitly showing parent-child relationships, revealing the causal structure underlying clinical events.
  • Figure 5: MedBeads User Interface. The DAG visualization (left) allows clinicians to trace the causal chain of medical events, offering a stark contrast to traditional list-based EMR views. Each node represents an immutable "Bead" of clinical data, linked by cryptographic hashes.