How to Build a Personal Health Record With an AI Agent: Six Folders Instead of an App
Medical data is usually scattered: lab results on lab websites, workouts in a fitness app, medications in a notes app. The authors of a write-up on Habr suggest skipping yet another app. Instead, give an AI agent a folder of files and a set of rules. The model reads the documents, reconciles the values and builds charts on request. The whole setup rests on six layers, from incoming files to finished reports.
AI-processed from Habr AI; edited by Hamidun News
Everyone accumulates medical paperwork: lab results, doctors' reports, prescriptions, blood pressure and weight readings. It ends up scattered everywhere: PDFs on a lab's website, scans in a folder, workouts in a sports app, medication names in notes. Finding a single test result is easy. Putting together the full picture before a doctor's visit is much harder. The author of an article on Habr proposes not writing an app for this, but building an environment in which an AI agent does the work.
Why Not a Standard Medical System
Specialized medical systems can only do what their developers built into them. If a program stores lab values and draws charts, that does not mean it can correlate them with medication intake or physical activity. Every such link requires data models, interfaces and algorithms.
The author starts from a different premise. Most tasks are operations on information: find documents, extract values, match dates and units, calculate, display. Modern models do exactly this well, provided they have access to the files. Functionality emerges from the request: "plot statin intake next to my blood chemistry" or "which medications was I taking during my physiotherapy course." There is no need to hunt for the right button or wait for a release.
For this reason, a database is not the foundation. Medical data is too heterogeneous: tables of values, text, images, complex documents. You cannot design a schema in advance that covers every case. The foundation here is plain files, and a database can be added later for specific tasks. The structure and working rules are described in AGENTS.md files, one in each directory. The approach is not tied to any particular model vendor.
Six Layers
The system works as a pipeline in which each layer gives a document a new property.
- Inbox. A temporary folder for new files: PDFs, photos, audio, exports. This is also where you can tell the model that two scans of opposite sides of a sheet are a single document.
- Originals. Files are never modified. You can only sort them into folders and give them clearer names. This exists for verification: recognition may have distorted values, and in a year you may want to run the document through a better model.
- Materials. Text versions of the originals: a recognized scan, an audio transcript, text extracted from a PDF. Each material links back to its source. If the model cannot make something out, it asks the user.
- Records. Structured facts: test values, visits, prescriptions. Here, different names for the same indicator are merged into one, units of measurement are converted to a common form, and duplicates and conflicts are cleaned up.
- Scripts. For repeated operations, such as importing hundreds of similar workout files, it is better to write a program than to hand the job to the model each time. The result is reproducible and verifiable.
- Output documents. Charts, tables, summaries and reports produced on request.
What Developers Can Take From This
The main idea reaches beyond medicine. Instead of an app with a fixed set of features, you build an environment from three parts: data, rules, and an agent with tools. The layers themselves look like a sensible engineering minimum for any task involving messy documents: don't lose originals, keep the link between derived data and its source, normalize data as a separate step, and move anything repetitive into code.
The author notes separately that scripts are not always needed. For one-off tasks, the model handles the job directly. It sometimes notices repetition on its own, but not always. This is an important limitation: a human also has to keep track of when an operation is being repeated.
Limitations
Recognition of photos and scans can make mistakes, which is why the originals layer and source links are mandatory here. Normalization of values from different labs needs to be checked: the model can match units incorrectly. The author's goal is not medical interpretation but preparing materials for a visit, and it is worth staying within that limit.
One addition from us: this involves the most sensitive kind of personal data. Before handing it to an agent, it is worth understanding where the model physically runs, what leaves your machine and who has access to the folder. The publicly available part of the article does not examine this question in detail, and the material breaks off at an example of processing a new test result.
The article comes with a template on GitHub with a README. If you are building agents to work with personal or corporate documents, it is worth opening. What you can borrow from it is not the medicine but the scheme itself: the file structure, per-directory instructions and the separation of originals, materials and records.
- Nov 12, 2026Claude in Chrome requires approval for every click on category 3 sites
- Nov 12, 2026Norwest raises record $4 billion fund, betting on agents, voice and physical AI
- Nov 12, 2026AWS shows how 100% retrieval precision can hide an AI agent's failure
- Nov 12, 2026Garage Eight dropped peer approvals for 69 MRs in an internal service using AI review
Key Questions Answered
Why Not a Standard Medical System?
Specialized medical systems can only do what their developers built into them. If a program stores lab values and draws charts, that does not mean it can correlate them with medication intake or physical activity. Every such link requires data models, interfaces and algorithms. The author starts from a different premise. Most tasks are operations on information: find documents, extract values, match dates and units, calculate, display. Modern models do exactly this well, provided they have access to the files.
What are the key details on Six Layers?
The system works as a pipeline in which each layer gives a document a new property. Inbox. A temporary folder for new files: PDFs, photos, audio, exports. This is also where you can tell the model that two scans of opposite sides of a sheet are a single document. Originals. Files are never modified. You can only sort them into folders and give them clearer names. This exists for verification: recognition may have distorted values, and in a year you may want to run the document through a better model. Materials.
What Developers Can Take From This?
The main idea reaches beyond medicine. Instead of an app with a fixed set of features, you build an environment from three parts: data, rules, and an agent with tools. The layers themselves look like a sensible engineering minimum for any task involving messy documents: don't lose originals, keep the link between derived data and its source, normalize data as a separate step, and move anything repetitive into code. The author notes separately that scripts are not always needed.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.