-
-
Record overview | Your medical history, linked back to the evidence.
-
Patient approval | AI proposes. Source wording checked. You decide what enters your record.
-
Direct Evidence | Exact source wording, document, page and patient-approval attribution.
-
Calculated Evidence | Deterministic rules and source-backed inputs. Chronology only, not care completion.
-
Longitudinal History | Dated measurements grouped by analyte, alongside documented events and recommendations.
-
Doctor Summary | A deterministic, evidence-linked medical brief composed from the same record
Inspiration
Medical history rarely lives in one place. It is scattered across lab reports, consultation notes, imaging reports and other PDFs, often created by different providers at different points in time.
AI can extract and summarize that information quickly, but in healthcare, speed is not enough. The harder question is: why should a patient or doctor trust a claim generated from a document?
MRI | Medical Records Interlinked started from that question.
The goal was not to build another AI medical summarizer. It was to explore a stricter model:
Every claim, back to its source.
What it does
MRI turns external medical documents into a patient-controlled, longitudinal record where every fact remains connected to the evidence that supports it.
The trust flow is deliberately explicit:
AI proposes → Source wording checked → You approve → Record updates
AI proposes candidate facts from a document, but it never decides what becomes trusted history.
Deterministic code checks each proposal against the source wording. The patient chooses which supported facts enter the record. Only after approval can deterministic code calculate relationships across the longitudinal history.
MRI distinguishes between two kinds of information:
Direct facts are explicitly stated in a source document. Their Evidence view shows the exact wording, document, page and how the fact entered the record.
Calculated statements are produced from already approved facts. Their Evidence view shows the deterministic rule and every source-backed input used to calculate them.
The Doctor Summary follows the same principle. It is generated from deterministic templates and trusted record data rather than generative AI.
The proof of concept
The broader record model is demonstrated through a curated synthetic medical history containing laboratory measurements, medication statements, imaging, recommendations and a documented incident.
The live Add record workflow is intentionally narrower. In this proof of concept, AI proposes only:
- ferritin measurements
- documented oral-iron status
This narrow scope made it possible to focus on the trust architecture rather than pretending to solve every kind of medical document extraction at once.
The demo uses clean text-layer PDFs and does not use OCR.
How we built it
MRI is a Next.js and TypeScript application. It runs locally and as a public synthetic demo at mri.stamatina.eu.
The hosted demo accepts the supplied synthetic sample PDF and keeps each visitor’s changes separate. Download the sample from the demo bar, then use Add record to review and approve its facts. Live extraction is rate-limited; the record and its source documents remain browsable.
The extraction workflow uses the OpenAI Responses API with structured output. AI proposes candidate facts with source excerpts, but those proposals are not trusted automatically.
Deterministic verification checks the proposed wording against the source document before the patient can approve it. Approval sends only selected fact IDs, and the source is checked again before trusted state is updated.
The record then derives longitudinal relationships in code.
For example, after a new ferritin result is approved, MRI can determine that a later ferritin result exists after an earlier recommendation. The Evidence view also states the limitation clearly: chronology alone does not prove that follow-up was timely, completed or medically appropriate.
Challenges
The biggest challenge was deciding where AI should stop.
It is easy to build a workflow where a model reads a PDF and immediately writes a polished summary. It is much harder to design a system where every step remains inspectable and where the model cannot quietly introduce unsupported meaning.
That led to several design constraints:
- patients approve source facts, not AI conclusions
- calculated claims must expose their inputs
- chronology must not be presented as clinical judgement
- prescriptions must not automatically become current medications
- source wording must remain traceable to the original document
- failed verification must never update trusted record state
The interface also had to make this trust model understandable without turning the product into a technical audit tool. The Direct and Calculated Evidence views became the key visual language for that distinction.
What we learned
The most important lesson was that trustworthy AI products may need less AI, not more.
AI is extremely useful for proposing structure from messy documents. But once a fact is going to become part of a trusted record, deterministic verification, provenance and explicit human approval become more important than generating another layer of fluent text.
MRI is a proof of concept, not an EHR replacement, clinical decision system or medical advice tool.
Its purpose is narrower:
to demonstrate that AI-assisted medical record building can remain useful while making every trusted claim inspectable.
No medical claim without provenance.
Built With
- claudecode
- next.js
- node.js
- openai
- openaicodex
- react
- responsesapi
- testing
- typescript
Log in or sign up for Devpost to join the conversation.