How Diplodoctor is built, and why
A short, honest account of the parts, what each one does and where it stops. Every sentence describes code in this repository as it is today; what is planned is labelled and points to the roadmap.
Why it is built this way
A lab report is a table of numbers with a range printed beside each. The hard part for a person is not the table; it is knowing what to ask, and trusting the answer.
A language model is good at reading the table and at saying in plain words what a measurement is for. It is the wrong tool for deciding whether 5.8 is above 5.6. So the model reads, and code compares.
And only a licensed professional may give medical advice where you are treated. A person who is not licensed can still help, and the product says what each one is. Diplodoctor is built to prepare that conversation, not to replace it.
Five parts, each with one job
- 01
Intake
A text box and up to four page photos, made smaller in your browser. Nothing is sent until you press the button.
- 02
Redaction
lib/redact.ts finds names, birth dates, addresses, insurance, order and phone numbers and replaces each with a placeholder, in the browser. You see every one and can switch it off.
- 03
Reading
One route calls ai-kit's complete() over the shared free chain, or your own key. The model returns one JSON object: values, units, ranges, the line each came from, plain-language information and questions.
- 04
Checks
The report schema, not the model, decides each flag by comparing the value with the printed bounds, and never lets the urgency fall below what the flags imply. A value is never shown without the line it was read from.
- 05
The file
One zod schema is the report: what the model produces, what the browser stores and what Export writes. A file that can leave is a file that belongs to you.
One reading, step by step
What happens between pressing the button and seeing the result.
- 01Your browser finds the personal details in the text and replaces them with placeholders.
- 02Only the anonymised text and your page photos go to the server.
- 03The server asks a model, from the free chain or your own key, to read the report. Nothing about it is stored or logged.
- 04The reply is checked against the schema, and every flag is recomputed from the numbers.
- 05Your browser puts the real values back where the placeholders were.
- 06The report is saved in this browser. The server has already forgotten it.
- Read a medical report
Paste it or photograph it: every value with its unit and printed range, which ones are outside it, what they measure, questions for your doctor and a translation. No account; names are removed in your browser first.
Works today - Anonymised before it leaves your browser
Names, birth dates, insurance and order numbers are replaced with placeholders in the browser, and you see every replacement before sending.
Works today - Follow a value over time
When the same measurement is in an earlier report in this browser, the earlier value and the direction are shown. Different units are never converted.
Works today - Any model, including your own
Free shared models by default, or your own key with a supported provider such as OpenAI, Anthropic, Google or Mistral. The key stays in your browser.
Works today - Connect your records
Swiss and European records as they are held: the electronic patient record (EPD), hospital portals and laboratory PDFs, not only US providers.
Planned - Ask a person, of your choice
Health assistants, anyone under a name or a pseudonym, shown with how helpful people found them, and licensed professionals offer their help as OrangeCat services, paid in any currency.
In development - Prove a licence without revealing who you are
A licensed professional shows with a zero-knowledge proof that their licence is valid, and can stay pseudonymous.
Planned - A health matter, worked by an agent
One workspace per concern: timeline, medications with dose and frequency, family history, reminders, and drafts that wait for your approval.
Planned - Wearables and exports
Apple Health and Android Health Connect exports, Garmin, Withings and Oura, when a matter needs them.
Planned - Clinics on their own models
Practices run Diplodoctor with models inside their own walls and receive patients' files by consent.
Planned
Principles
Information, not diagnosis
The model is told never to diagnose, advise on medicines or reassure. The product repeats it wherever a result is shown.
Nothing is claimed that is not true
Every capability has a status in one file, and the pages read it. Nobody is listed, rated or quoted who does not exist.
Open source
The code, the prompt and the tests are public under the MIT licence, so a claim here can be checked there.
Shared ground
Design, models, limits and records come from packages the whole fleet uses, not from copies.
The stack
The same column of packages as the rest of the fleet.
- Framework
- Next.js 16, React 19, TypeScript
- Models
- @bitbaum/ai-kit complete() over the free chain; your own key
- Privacy
- lib/redact.ts in the browser; CSP with a nonce
- Design
- @bitbaum/design-tokens
- Roadmap
- ROADMAP.md and CHANGELOG.md, read through bip-kit
- Rate limits
- limitkit, in memory
- Languages
- next-intl: en, de, fr, it, es
- Tests
- Vitest; the model call is injected
- The problem
- A lab report reaches the person it is about as a page of values, units and printed ranges that they usually cannot read on their own.
- What we built
- Paste or photograph a lab report and see every value, which ones are outside their printed range, what they measure and what to ask your doctor, without an account and in five languages. The AI reads and explains but never diagnoses or prescribes; health assistants anyone can be, and licensed professionals where the law reserves the work, help with the rest.
- Mission
- Help anyone understand their own medical results, with the person deciding what leaves them and who helps.
- Vision
- Three kinds of help in one place: any AI model, health assistants, and licensed professionals who can prove their licence without revealing who they are, each saying only what they are allowed to say.
Where it goes
Health matters worked by an agent, and people you choose to help: assistants, and licensed professionals who can prove their licence without revealing who they are. What is built and what is not is on the roadmap, in that order.