Live Nov 18 · Cohort 3Nov 18, 19:00 MSK — free hands-on AI agents live workshop · Live Cohort 3 starts Nov 23Join Nov 18 Live →Cohort 3 (Nov 23)
ReleaseInsight · On RadarHabr AI→ original

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
How to Build a Personal Health Record With an AI Agent: Six Folders Instead of an App
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1Originals are never modified, so you can check the recognition results
Key metric #2Repeated operations go into scripts for reproducibility
Key metric #3The rules for the model live in an AGENTS.md file in each directory

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.

Story

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.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

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.

Try Nomad AI →Launch Nomad Agent
What do you think?
Loading comments…