LongitudinalClinicalGraphMemory Agent

From mdbabumiamssm/LLMs-Universal-Life-Science-and-Clinical-Skills- · View interactive version

LongitudinalClinicalGraphMemory Agent is an AI agent skill from the GitHub repository mdbabumiamssm/LLMs-Universal-Life-Science-and-Clinical-Skills-. Build and evaluate dated, person-attributed graph memory for longitudinal clinical dialogue, testing stale patient states, mistaken person attribution, and missing safety evidence.

How to use this skill

Skill file

<!--

COPYRIGHT NOTICE

This file is part of the "Universal AI Agentic Skills" project.

Copyright (c) 2026 MD BABU MIA, PhD <md.babu.mia@mssm.edu>

All Rights Reserved.

#

This code is proprietary and confidential.

Unauthorized copying of this file, via any medium is strictly prohibited.

#

Provenance: Authenticated by MD BABU MIA

-->

<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->


name: 'longitudinal-clinical-graph-memory'

description: 'Build and evaluate dated, person-attributed graph memory for longitudinal clinical dialogue, testing stale patient states, mistaken person attribution, and missing safety evidence.'

measurable_outcome: 'Execute skill workflow successfully with valid output within 15 minutes.'

allowed-tools:


Longitudinal Clinical Graph Memory

Overview

Construct and evaluate research memory for medical conversations across visits, preserving changing patient states and their source evidence. The MedGraph finding motivates dated, person-attributed fact chains and a safety profile to address stale evidence, facts assigned to the wrong person, and omitted safety facts. The schema and evaluation procedure below are proposed implementation guidance, not a verified reproduction or evidence of clinical readiness.

When to Use This Skill

Core Capabilities

  1. Define a bounded research run. Select an authorized, preferably de-identified dialogue sample, patient identifier, evaluation questions, and evidence cutoff. For the 15-minute workflow, use a small fixture that exercises all three failure modes; report incomplete work explicitly rather than implying a full benchmark run. Keep patient dialogue out of public web queries.
  1. Extract attributable facts. Read each session into atomic records. Separate the speaker from the person described; attach family-history facts to the relevant relative and relationship. Preserve negation, uncertainty, and whether a statement is reported, hypothetical, or confirmed. Assign unresolved references to an unknown subject pending review, rather than defaulting them to the patient.
  1. Represent time and provenance. Give every fact a stable identifier, subject, clinical concept, value or status, event time or interval, recording time, session identifier, and exact source span. Preserve raw date expressions and time precision. An undated event remains undated; the session timestamp alone does not establish when the clinical state began.
  1. Maintain state chains. Group compatible medication, diagnosis, and measurement records by subject and concept. Append changes with explicit links such as updates, stops, corrects, or contradicts, retaining prior records. Distinguish a prescription from reported use and a suspected diagnosis from a confirmed one. Repeated measurements form observations over time; a new measurement does not invalidate an old observation. Never merge records solely because their text is similar.
  1. Resolve the requested temporal view. Identify both the clinical time the question concerns and the information available at the evaluation cutoff. Exclude later-recorded evidence when testing what was known at an earlier visit. Use explicit effective dates and supported transitions to reconstruct state; do not assume the latest recorded statement is automatically correct. Return competing evidence and an unresolved state when contradictions or missing dates prevent a defensible selection.
  1. Retrieve chains with evidence. Filter to the target subject before ranking relevant chains. Read selected chains at the requested time and attach original dialogue spans to the resulting evidence packet. For questions about relatives, retrieve those subjects explicitly and label the relationship. Distinguish evidence retrieval from answer generation and support each answer claim with fact identifiers and source spans; abstain on unsupported claims.
  1. Include recorded safety evidence. Maintain a patient profile containing every recorded safety fact, such as explicitly stated allergies or adverse reactions, with dates, status, and provenance. Attach this profile to every question independently of relevance ranking. Preserve retractions and contradictions with their context, and distinguish historical information from the requested state. Missing documentation means unknown, not a negative finding; if the profile cannot fit, report incomplete safety coverage instead of silently dropping entries.
  1. Evaluate the three failure modes. Label expected subject, temporal state, and required safety evidence for each question before scoring. Include synthetic cases for a medication stopped after an earlier visit, a relative's condition mentioned by the patient, and a safety fact recorded far from the relevant question. Mark these as local fixtures, not MedMemoryBench examples. Compare systems on the same questions, available history, answer model, and declared resource settings.
  1. Report validity and limitations. Check that all selected facts resolve to source spans, chain links stay within the intended subject and concept, and historical views exclude disallowed future evidence. Report observed failures, sample sizes, retrieval settings, elapsed time, and any untested behavior. Paper-level results do not establish performance on the local sample or clinical deployment safety; deployment claims require separate evidence and clinical evaluation.

Inputs / Outputs

Inputs

If subject identity, timestamps, or reference labels are unavailable, retain explicit unknowns and describe the affected checks as unscored. Do not invent patient facts or reference answers to fill gaps.

Outputs

Use these local metric definitions consistently; they are proposed operational measures, not claimed definitions from the paper:

| Measure | Definition |

|---|---|

| Stale-state error rate | Scorable temporal questions with a selected state inconsistent with the reference time / scorable temporal questions. |

| Wrong-person contamination rate | Scored question packets containing another subject's facts presented as the patient's / scored packets. |

| Required safety-evidence recall | Required reference safety facts included with provenance / all required reference safety facts. |

| Provenance coverage | Selected facts with resolvable supporting source spans / all selected facts. |

Report numerator and denominator for each measure; use N/A for a zero denominator. Record abstentions separately so omitting evidence cannot appear to eliminate retrieval errors. A valid small-run output contains the ledger, graph, safety profile, evidence packets, and an honest evaluation report within the declared time budget; it does not require a perfect score.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.