solo project
MedMemGraph
Role: Sole engineerPython · Property Graph · Clinical NLP
Graph-native longitudinal memory for clinical AI agents — it remembers a patient across admissions, answers by walking a fact graph, and can always show why it believes an answer.
PythonHydraDB (graph)Property graphClinical NLP
Context
Built for HackHydra — Track 03 (Memory & Context Retrieval). A clinical assistant that spans many hospital admissions needs real memory: it has to recall what happened last visit, compare across visits, and — critically in a medical setting — never make something up.
Problem
The default pattern, chunk-similarity RAG, ranks passages by embedding distance. That loses provenance (you can't trace an answer back to the fact that justified it) and it fails silently on absence — ask about something the record doesn't contain and a similarity search still returns the "closest" chunk, inviting a confident, wrong answer.
Approach
- Facts as versioned graph nodes. Multi-admission conversation histories are parsed into clinical facts stored as versioned nodes in a property graph, rather than flattened into text chunks.
- Retrieval by traversal, not ranking. Questions are answered by walking weighted paths through the graph (HydraDB SPpaths /
SSpaths / MSpaths path-enumeration), so a "why do you believe this?" query returns the actual provenance trail it traversed.
- Structural absence detection. When no supporting path exists, the system declines to answer instead of guessing — turning "I don't have that" into a first-class, structural outcome.
- Cross-admission reasoning. Multi-hop walks synthesize comparisons across visits ("how has this changed since last admission?") that a single chunk lookup can't express.
Results & what I learned
- A working end-to-end prototype: ingest histories → build the fact graph → answer questions with a provenance path attached and an explicit refusal path for unanswerable ones.
- Learned: for high-stakes retrieval, representing knowledge as a traversable graph buys you two things vector similarity can't — explainability (the path is the citation) and honest absence (no path ⇒ no answer).
Honest scope: this is a hackathon prototype (~10 commits, Track 03) built on the HydraDB OSS graph engine (an AGPL-3.0 dependency) — a demonstration of the graph-memory approach, not a deployed clinical system. Retrieval quality is shown by construction (paths + refusals); I have not yet benchmarked it head-to-head against a vector-RAG baseline, which is the honest next step.