MedGraph: Using Graph Memory to Track Patient State and Improve Accuracy in Long-Term Medical Conversations

MedGraph uses graph memory with dates and person attribution to solve state tracking in long-term medical conversations.
The article addresses the memory challenge of LLM medical assistants tracking patient states in long-term conversations, identifying three recurring errors in five existing memory systems: retrieving outdated states, mixing in others' health facts, and missing critical safety information. It proposes MedGraph, which extracts dated facts per session and attributes them to specific people, links medication, diagnosis, and measurement records into chains to preserve earlier states, ranks by patient chain during retrieval, reads each chain at the question's time point, supplements with original conversation text, and associates all safety facts via the patient profile. On MedMemoryBench, MedGraph achieves the highest overall accuracy with GPT and Qwen backbones, leading the strongest baseline by 10.5 and 10.4 percentage points, validating the effectiveness of graph memory in long-term medical conversations.
In long-term medical conversations, a patient's state changes over time, and LLM assistants need to accurately track these changes. Existing memory systems often make three types of errors: retrieving outdated states, mixing in other people's health facts, and missing critical safety information. MedGraph significantly improves answer accuracy by building graph memory that links facts into chains by date and person attribution, and reads them at the time point of the question during retrieval. On MedMemoryBench, MedGraph achieves the highest overall accuracy with both GPT and Qwen backbones, leading the strongest baseline by 10.5 and 10.4 percentage points, respectively.

The Memory Challenge in Long-Term Medical Conversations
LLM medical assistants need to track patients across visits, and memory must remain correct as clinical states change. The study analyzed errors of five memory systems in longitudinal medical conversations and found three recurring causes: retrieved evidence reflects outdated states, contains other people's health facts, or lacks the safety facts on which the answer depends. These errors are especially fatal in long-term conversations because patient states are dynamic, while traditional memory systems often store information statically.
LLM memory systems generally refer to mechanisms that store historical information outside the model's context window through external storage (such as vector databases, knowledge graphs, or structured profiles) and retrieve and inject it into the prompt when needed. Common implementations include: sliding windows that retain recent conversation, summarization that compresses history, vector retrieval of similar snippets, and entity- or time-based structured storage. These approaches perform reasonably well in general conversations, but face special challenges in medical scenarios—patient states change dynamically with visits, medications, and test results; the same fact may have different clinical meanings at different time points; and static storage or pure similarity retrieval cannot express the time and attribution dimension of "when and for whom a fact holds."
MedGraph's Graph Memory Design
MedGraph is designed to address the above three types of errors. In the construction phase, it extracts dated facts from each session, attributes each fact to the person it describes, and links medication, diagnosis, and measurement records into chains that preserve earlier states. In the retrieval phase, it ranks by patient chain as the unit, reads each chain at the time point asked in the question, and supplements with the original conversation text; the patient profile lists all recorded safety facts and associates them with each question. This design ensures that memory includes both the temporal dimension and explicit person attribution, while not missing safety information.
Knowledge Graph uses nodes to represent entities and edges to represent relationships between entities, making it naturally suited to expressing the multi-dimensional structure of "person—fact—time." In medical memory, the graph structure can treat patients, medications, diagnoses, and measurement values as nodes, and "took," "diagnosed at," "measured as," etc. as timestamped edges, so that retrieval traverses along edges rather than merely performing text similarity matching. Compared with vector retrieval, the advantages of graph memory are: it can explicitly constrain person attribution (expanding only along the target patient's edges), filter edges by temporal conditions (reading states before the question time point), and preserve the history of state evolution through chained paths, preventing earlier facts from being overwritten by later records.
Experimental Results and Performance
On the MedMemoryBench benchmark, MedGraph achieves the highest overall accuracy under both GPT and Qwen backbone models, outperforming the strongest of the five baselines by 10.5 and 10.4 percentage points, respectively. Under the GPT setting, memory construction and answering efficiency are also high. This shows that the graph memory structure can effectively solve the state-tracking problem in long-term medical conversations and provides a new direction for memory design in LLM medical assistants.
MedMemoryBench is a benchmark specifically designed to evaluate LLM memory capabilities in longitudinal medical conversations. Its questions cover dimensions such as state tracking, person attribution, and recall of safety facts, requiring models to answer based on historical records across multiple sessions rather than relying only on a single conversation context. Such benchmarks typically contain conversation sequences with multiple patients and multiple time points, and include distractors to test whether the system misuses other people's facts or outdated states. Comparing different memory systems on this benchmark can distinguish "retrieving relevant content" from "retrieving relevant content at the correct time point and for the correct person," thereby exposing the systematic deficiencies of traditional memory approaches in the temporal and attribution dimensions.
One-line Summary
MedGraph uses graph memory with dates and person attribution to solve the state-tracking challenge in long-term medical conversations.
Paragraph Summary
The article addresses the memory challenge of LLM medical assistants tracking patient states in long-term conversations, pointing out that five existing memory systems repeatedly make three types of errors: retrieving outdated states, mixing in other people's health facts, and missing critical safety information. To address this, it proposes MedGraph, which in the construction phase extracts dated facts from each session and attributes them to specific people, linking medication, diagnosis, and measurement records into chains to preserve earlier states; in the retrieval phase, it ranks by patient chain as the unit, reads each chain at the time point asked in the question, supplements with the original conversation text, and associates all safety facts through the patient profile. On the MedMemoryBench benchmark, MedGraph achieves the highest overall accuracy with both GPT and Qwen backbones, leading the strongest baseline by 10.5 and 10.4 percentage points, respectively, validating the effectiveness of the graph memory structure in long-term medical conversations.
Related articles
Tech FrontiersColdframe: A Honeypot Disguised as a Supermarket Freezer Controller
Coldframe is a honeypot disguised as Danfoss AK-SM 800A and Dixell XWEB freezer controllers, built as a single Python file that detects CVE-2025-41450 attempts and is identified as real devices on Shodan.
Tech FrontiersGRFNet: A Lightweight PyTorch Model Designed for Multichannel Time-Series Classification
GRFNet is a lightweight PyTorch model for multichannel time-series classification, originating from EEG decoding research. With only 3,847 parameters, it is based on the ROCKET architecture, combining random convolution kernels with learnable spatial filters, supports arbitrary input lengths, and will soon be evaluated on the PhysioNet dataset.
Tech FrontiersCUDA-Accelerated Rocket League Simulator: A Player-Made Hardcore Experiment
A Reddit post shows a "100% Accurate" Rocket League simulator accelerated with CUDA. We analyze its technical context, CUDA's value in game physics simulation, and the significance and limitations of such community projects.