PTENES
MODULE 1.1

🫀 What is HealthOS

Before you build, understand the central idea: a health coach that thinks with the your data—wearable, blood, DNA, and diet—inside Telegram. Here you'll see the problem it solves, how the pieces fit together, and why this is different from asking a chatbot for advice.

7
Topics
~35
Minutes
Basic
Level
Theory
Type
Your progress in this module 0% · 0 of 7
1

🎯 The problem: generic advice × your data

Ask a regular chatbot "should I drink coffee now?" and it replies with a internet average: “avoid after 2 p.m.” The answer is the same for everyone—it doesn’t know how you slept, what time it is for your body, or how you metabolize caffeine. HealthOS replaces that average with an answer grounded in you.

✗ Generic advice

  • ✗"Sleep 8 hours" — without knowing how much YOU slept last night.
  • ✗"Eat less salt" — without seeing your blood pressure rise 10-15% after a salty lunch.
  • ✗It forgets everything in the next conversation. No memory, no pattern.

✓ Coaching with your data

  • ✓"Recovery 48% today — yesterday’s wine probably took a toll. Take it easy."
  • ✓"You metabolize caffeine quickly (CYP1A2): coffee early, cut it off in the afternoon."
  • ✓Remembers weeks ago: "every time you eat dinner late, your sleep suffers".

💡 The idea in one sentence

Specific beats generic. A coach grounded in your labs, genetics, and goals gives advice mechanism-aware (you know the “why” in your body); a generic bot offers platitudes. The entire HealthOS design forces this specificity.

Key concepts

Specific

A response grounded in your numbers, not the average.

Memory

Remembers your history and sees patterns over the course of weeks.

Mechanism

Explain the cause in your body, not just the recommendation.

Your data

Wearable + blood + DNA + diet, together.

2

🫀 What exactly is HealthOS

HealthOS is a complete blueprint (a model project, ready to clone) for a personal health coach that lives in a Telegram bot. You talk to it by message; behind the scenes, it stores everything in a database just for you, reads your wearable, and always responds based on your current context.

🟢 New here? Three words before you continue

  • LLM — is the kind of AI model that runs behind ChatGPT/Claude. It’s the “brain” that reads your data and writes the response.
  • Coach (agent) — this isn’t just a chat: it’s a agent, a program that acts on its own (fetches your data, writes to the database, triggers the morning review) in addition to chatting.
  • Mechanism-aware — “mechanism-aware”: instead of just telling you to “drink less coffee,” it knows the physiological reason in YOU (e.g., your caffeine gene) and acts on it.

📦 What’s included

  • •One coach on Telegram grounded in your data, not generic advice.
  • •One own database (Supabase) with food, workouts, weight, caffeine, supplements, vital signs, lab results, check-ins, and goals — plus message memory.
  • •A wearable connection (WHOOP in the example) end to end: authorization, daily sync, and data mapping.
  • •A recovery-guided morning review and a dashboard with the trends.

🧭 Where it runs

You point your Claude Code or Codex to the repository and builds yours. The example uses WHOOP, but any source works (Apple Watch, Garmin, or manual logging) — the coach works with whatever reaches the database. The author ran this live for 15+ days before publishing.

Key concepts

Blueprint

Template project ready to clone and customize.

Telegram

The interface: you talk through messages.

Own database

Your data in your own private Supabase.

Agent

Acts on its own, not just responds.

3

🧩 The 4 data sources

The coach’s strength comes from cross-reference four sources that usually live in separate apps. On its own, each is one piece; together, they provide context. The diagram below shows all four converging into a single coach.

⌚ Wearable (WHOOP) 🩸 Blood tests 🧬 DNA (SNPs) 🍽️ Diet (photo) Coach cross-reference everything Advice personalized for you

📊 How to read: the four sources (cyan, on the left) feed into the coach, which combines them and returns specific advice (green). No source alone would be enough — the value lies in the cross-referencing.

1

⌚ Wearable

Recovery, heart rate variability, resting heart rate, and hours of sleep. It’s “how your body woke up today.”

2

🩸 Blood

Markers such as ApoB, HOMA-IR, vitamin D. The biochemical snapshot of your metabolism and risk.

3

🧬 DNA

SNPs (genetic variations) that adjust dosages: caffeine, saturated fat, vitamin D, salt. Genes as buttons.

4

🍽️ Diet

Food photo → macros estimated by vision. Closes the loop between what you eat and how you recover.

Key concepts

Wearable

How your body woke up today.

Blood

The biochemistry of metabolism.

DNA

Adjusts dosages — genes as switches.

Cross-reference

The value comes from bringing all four together.

4

🏗️ High-level architecture

Every time you send a message, the same sequence happens: the agent reads a snapshot (a compact summary of your current state) from the database, reasons with the LLM grounded in your data, and responds. Follow the flow in the diagram.

🟢 New here?

  • Supabase — is a cloud database (PostgreSQL) with file storage. It’s where ALL your health data lives, in a private project just for you.
  • Session snapshot — a compact snapshot of “right now”: weight trend, what you ate today, blood pressure, yesterday’s recovery, the 7-day sleep pattern, and your goals. The agent reads this at the start of every conversation so it can always respond with current context.
💬 Telegramyou 🤖 Agentcoach 🗄️ Supabasesnapshot 🧠 LLMreasons the response returns to Telegram (dashed line)

📊 How to read: from left to right is the path of the question; the dashed line is the answer coming back. The agent never "guesses": it always reads the database snapshot before reasoning.

🧠 Memory is the product

Everything is written to the database as structured rows. That's why the coach knows your entire history and can spot patterns over weeks — it doesn't just react to the latest message. We cover these modules in detail in Track 1 (signals and memory) and Track 2 (the database).

Key concepts

Snapshot

A compact snapshot of "now," read at every turn.

Agent

Orchestrator: reads, reasons, writes, responds.

Supabase

The private database where everything is recorded.

Memory

Structured lines = patterns over time.

5

🌅 A day in the life of a coach

The whole day happens in Telegram. The example below is illustrative (fictional numbers, not advice) — shows how the loop closes: today’s choice becomes tomorrow’s recovery.

🌅 07:00 morningrecovery 71% (green) ☀️ during the daycoffee, exercise, dinner 📝 logeverything becomes a row in the database 🌙 following morningrecovery 48% (amber) the loop closes: the next morning becomes the new recovery-guided review

📊 How to read: today's recovery starts the day; your choices are recorded; tomorrow's recovery reflects those choices. This cycle is the backbone of HealthOS — it teaches you your own buttons.

07:00 "Recovery 71% (green), slept 7h20, HRV 64. Yesterday’s protein hit the target and coffee was early — that’s why you’re in the green. Today is a push day; have carbs around your workout."
08:30 Breakfast photo → "~38g protein, low saturated fat, logged." (writes a row to food_log)
13:00 "Coffee now?" → "You’re in the green and it’s early, so go ahead. Stay below your limit and cut it off by mid-afternoon."
19:00 "Steak and a glass of wine" → logged; the coach notes that alcohol may weigh on your overnight recovery.
Day +1 "Recovery dropped to 48% (amber) — the wine and late dinner are the likely cause. Take it easy today; focus on protein, fiber, and hydration."

Key concepts

Recovery starts the day

The morning number determines whether to push or rest.

Loop closes

Today’s choice becomes tomorrow’s recovery.

Everything logged

Each choice becomes a row in the database.

Your buttons

You learn what affects your body.

6

🔒 Privacy and security

Health data is sensitive. HealthOS is locked by default: private project, server-side access, secrets kept out of git. Nothing leaves except the LLM calls you choose to make.

🟢 New here?

RLS (Row-Level Security) — “row-level security.” It’s a database feature that decides who can read each row. In HealthOS, RLS stays enabled without any policy: the public (anon) key can’t read anything, and only the server (with the service-role key) can access it. Result: no one outside can read your data.

✓ What the design guarantees

  • ✓Supabase project private, in your account.
  • ✓RLS enabled, no policies: the anon key can’t read anything.
  • ✓Secrets in ~/.env (your home directory), never in git.

✗ What to never version-control

  • ✗Your CLAUDE.md filled in (real profile).
  • ✗The seed's actual values and your photos.
  • ✗The file ~/.env with the keys.

Key concepts

Private

The database is yours, in your account.

RLS

No one outside can read your entries.

Secrets

In ~/.env, outside version control.

You send

Nothing goes out beyond what you choose.

7

⚠️ Not medical advice · cost and prerequisites

Before anything technical, the most important rule in the entire course: this is a tool for logging and reasoning, not a doctor.

⚠️ Not medical advice

  • •It’s the example of a person, who consulted doctors at every step. This is not a prescription for you.
  • •AI can hallucinate. Treat every suggestion as a question to discuss with your doctor, never as an order.
  • •The coach is instructed to no diagnose or change medication; it refers you to a clinician.
  • •DNA samples mailed in degrade — the clinic’s panel and Ancestry’s may not match.

💰 How much it costs to run

  • Supabase — the free plan is enough for one person.
  • LLM + embeddings — the calls you make (cents for embeddings; ~US$10-20/month for typical usage).
  • Vision (Gemini) — cents per photo.
  • WHOOP — the API is free with the subscription. Don’t have WHOOP? Use another wearable or manual logging.

🧰 What you’ll need (overview)

Python 3.9+, Node, a Supabase account, a Telegram bot, and API keys (OpenAI, Gemini, optionally WHOOP). Don’t worry about having everything now — the Track 2 (Step by step) builds each piece with you, from scratch.

Key concepts

Doctor in the loop

Have a clinician verify everything.

Cheap

Free tier + ~US$10-20/month.

WHOOP optional

Any source works.

Track 2 builds

The prerequisites are covered in the step-by-step instructions.

✅ Self-check (optional): what makes HealthOS different from a regular chatbot?

📋 Module summary

✓
Specific beats generic — the coach thinks with your data, not with the internet’s averages.
✓
Four cross-referenced sources — wearable, blood, DNA, and diet all in one place.
✓
Snapshot every turn — the agent always responds based on your current state, and memory becomes a pattern.
✓
The recovery loop — today’s choice becomes tomorrow’s number; it’s the backbone of the day.
✓
Locked and non-medical — private by default; always with a clinician in the loop.

Next module:

1.2 — Body signals: recovery, HRV, RHR, sleep, and the blood markers your coach reads.