Virtual File System
How the VFS gives AI agents a predictable, self-describing path structure for navigating patient data.
The Virtual File System (VFS) exposes the clinical knowledge graph as a familiar directory structure. An agent that has never seen this patient can discover what's there by browsing without upfront knowledge of the data structure required.
Path Structure
/patient/{id}/
├── conditions/
│ ├── active/
│ │ ├── fct_k3v9q2m7x1c8b5n4z6w0a2d1/ ← Type 2 diabetes mellitus
│ │ │ ├── _story.md ← longitudinal condition narrative
│ │ │ └── _narratives/ ← narratives a verdict links to this condition
│ │ └── fct_p8d4w1n6y3t9s2f7j5g0c8m3/ ← Hypertension
│ └── resolved/
├── medications/
│ ├── active/
│ │ └── fct_h7r2c9x4m1p8q5v3n6b0z2w4 ← metformin, oral
│ └── discontinued/
├── allergies/
├── directives/
├── encounters/ ← visits that addressed a condition
│ └── 2026/
│ └── ece_w2c7m5x9q1r4t8k3v6z0b5n2 ← Cardiology visit
├── timeline/ ← every event, by year
├── labs/
│ ├── latest
│ └── trends/
├── insurance/
├── family_history/
├── social_history/
├── memory/
│ ├── symptom.md
│ ├── adherence.md
│ ├── concern.md
│ └── preference.md
└── sources/
└── progress_note/ ← documents sharing one title, newest first
└── en_d5k1p9s3x7c2v8n4q6w0m1t7/
└── progress_notes_a3f21b08.md ← one section of one documentAn entry that stands for one condition, medication, encounter or document is named by its id. Its listing carries a display field with the readable name, shown after the arrows above. See Entry names.
Every directory above sources/ answers a clinical question — what conditions, what medications. sources/ is a raw view of the inputs those answers were assembled from, browsable as documents rather than as facts. It is not a bibliography for the directories above it: nothing leads from a condition or medication to the document it came from. See VFS Paths.
It is also the verbatim layer: every narrative in the tree is a reading of prose stored here, and this is the only place the wording as it was originally recorded can be read.
Documents are grouped by title rather than listed flat (for example sources/progress_note/). This facilitates progressive discovery by agents.
Navigation Pattern
The VFS is designed for progressive discovery:
→ browse_patient("/patient/abc/")
← conditions/ medications/ allergies/ encounters/ timeline/ labs/ memory/ sources/The root lists every directory, including one with nothing in it for this patient.
→ browse_patient("/patient/abc/conditions/active")
← 📁 fct_k3v9q2m7x1c8b5n4z6w0a2d1 · Type 2 diabetes mellitus — status: active | onset: 2016-03-01
📁 fct_p8d4w1n6y3t9s2f7j5g0c8m3 · Hypertension — status: active | onset: 2019-05-12
📁 fct_b6x2r9k4h1v7q3z8n5d0t2w6 · Chronic kidney disease stage 3b — status: active | onset: 2021-09-30→ browse_patient("/patient/abc/conditions/active/fct_k3v9q2m7x1c8b5n4z6w0a2d1/")
← 📄 _story.md — status: active | onset: 2016-03-01
📁 _narratives — 2 narratives · 1 conflicting→ read_patient("/patient/abc/conditions/active/fct_k3v9q2m7x1c8b5n4z6w0a2d1/_story.md")
← # Type 2 diabetes mellitus
**Status:** active
**Onset:** 2016-03-01
...
The _story.md file is a pre-assembled longitudinal narrative that contains onset, current medications, monitoring labs, and complications in a single read. See Condition Stories for the full structure. The _narratives/ directory beside it holds the narratives a verdict links to this condition — clinical prose from the ingested documents, each read carrying the reasoning behind its verdicts.
No graph query knowledge needed. The agent navigates what's there.
Content Formats
The read_patient tool accepts a format parameter to control verbosity:
| Format | Use when | Typical tokens |
|---|---|---|
narrative | Agent needs full clinical context | 300–800 |
structured | Agent needs machine-readable fields | 200–500 |
compact | Agent is scanning many items | 50–150 |
Virtual, Not Physical
No files exist on disk. Every path has a resolver function that materializes content from the graph on demand. This means:
- Content is always current. No synchronization needed
- Token budget is enforced at the rendering layer
- The VFS can be extended with new paths without changing the underlying data model
Patient ID in Paths
VFS paths are relative to the patient, such as /conditions/active, because the REST route or the MCP tool already names the patient by its patient ID. The VFS also reads a path that starts with /patient/{patientId}/.
How Agents Get Patient Context
Why agents read a patient's memory through a file system, the three ways to read it, and why assembled context costs fewer tokens than raw records.
Condition Stories
Pre-computed longitudinal narratives that give AI agents full clinical context for a condition in a single read.