Sorir icon AI-native health OS

Sorir শরীর

An AI-native health OS with persistent memory.

One coherent system that connects every signal from your body — food, biomarkers, sleep, recovery — and actually remembers who you are. Native to iOS 26, built evidence-first, engineered to stay cheap at scale.

6data pillars
4-layermemory architecture
~2,500tokens of context / call
Sorir advisor screen: a natural-language meal description is parsed into logged foods with calories and macros, including a spoken voice note, with a running macro total.
The problem

You already run a health OS.
It's just held together by hand.

A serious health routine today is a duct-taped stack of apps that neither remember you nor talk to each other. Sorir replaces the whole stack with one system.

✕ Gemini chat ✕ MyFitnessPal ✕ Athlytic ✕ Oura ✕ Scattered lab PDFs
One system that remembers you — and connects every source intelligently.
01
No persistent AI memory

Re-explaining your entire health history to a chatbot every single conversation. Its memory is conversation-bound; yours should be longitudinal.

02
A tedious logging loop

Chat to estimate a meal, then re-enter it somewhere else. Two tools, one meal, every time.

03
Manual synthesis

Mentally stitching together recovery, sleep, blood panels and nutrition — work no single app will do for you.

The data layer is the moat

Six pillars of structured, longitudinal health data

Every signal lands in one open schema — so the AI can connect supplements to biomarkers to training load, over months, not messages.

Food logging

Text + audio, never photos. Backed by a three-tier lookup so most meals never touch an LLM.

Biomarkers

~40–45 markers in an open key-value schema. Reference ranges are optimal, not lab-default.

Lab PDF parsing

Two-stage: fast text extraction first, a vision-LLM fallback only for scanned, image-only reports.

Body composition

HealthKit basics plus InBody PDF ingestion — segmental, ECW and visceral detail.

Supplements

Self-logged and enriched by a reference database, so the AI can tie doses to changing markers over time.

Day-one history import

Upload 12 months of blood panels and 26 body scans at once. One batched summary call — so the AI starts knowledgeable, not cold.

What it does

A clinical sports nutritionist who is also a data scientist

Not a hype coach. Every surface is evidence-based, grounded in your own numbers, and built to feel like it belongs on iOS 26.

Advisor with memory

Talk to something that already knows your history

The advisor assembles your full longitudinal context before it answers — profile, a rolling clinical summary, semantically-retrieved past events, and freshly-computed numbers. It's what a conversation-bound assistant structurally cannot do.

  • Database-bound memory, not conversation-bound — it persists across every session.
  • Answers are grounded in computed values, never guessed from raw rows.
  • A clinical, evidence-first voice — reference ranges follow sports-medicine and longevity literature.
Advisor conversation parsing a described meal into individual logged foods with per-item calories and macros and a running total.
Text & audio food logging

Say what you ate. It does the rest.

Type or speak a meal in plain language. A deterministic parser handles quantities, units and fractions first; a single cheap model call fires only when an item is genuinely ambiguous. On-device dictation commits each phrase and survives pauses.

  • Deterministic-first — most items are matched with no LLM at all.
  • Every log does a write-then-read to Apple Health, so totals never double-count.
  • Refine one of your own foods and corrected macros retro-propagate to past logs.
The 'Tell us what you ate' sheet with a sample entry '2 rotis and a bowl of dal', a Speak button and a Log Meal button.
Energy dashboard

The whole picture, sourced live from Apple Health

Calorie balance, macros, workouts and multi-month trends — all read live on-device, with nothing stored as a stale total. Balance is simply consumed minus spent, computed the moment you look.

  • Spent, consumed and balance read live from HealthKit, never cached.
  • 7-day and weekly calorie-balance trends with weight overlay.
  • Macro-consumption history you can drill into by nutrient.
Energy dashboard showing a calorie-balance ring, macro breakdown, workouts from Apple Health, and multi-month calorie-balance and macro trend charts. Demo data.
Liveliness & recovery

Am I recovered — push, or rest?

Liveliness is the hero metric of the Today screen: a 0–100 readiness score of you today versus your own 60-day baseline. HRV-led, with five contributors, so a normal day always anchors around the middle and a real change stands out.

  • Relative to your own baseline — not a population average.
  • Contributors: HRV, resting heart rate, sleep, respiration, body temperature.
  • A one-line read on whether today is a day to train or recover.
Liveliness readiness screen: a speedometer gauge reading 80 'READY', up 14% vs a 60-day average, with contributor rows for HRV, resting heart rate, sleep, respiration and body temperature. Demo data.
Sleep & proactive insights

It connects the dots you'd never sit down to connect

A nightly composite sleep score against science-anchored targets, plus a background insight engine that reads across all six pillars and surfaces findings without being asked — the kind of cross-month synthesis no single app will do for you.

  • Sleep score with a scrubbable hypnogram and per-source breakdown.
  • A scheduled background worker mines months of data for what changed.
  • Example insight: “Your Vitamin D moved from 28 → 52 ng/mL since you raised the dose three months ago — maintain, don't increase.”
Sleep score screen showing a composite score of 78 'GOOD' with contributor rows for duration, REM, deep sleep, restfulness, efficiency, latency and timing. Demo data.
The engineering blueprint

How it actually works

A native client, a dedicated serverless backend, and a Postgres brain — wired together so the AI is powerful, personal, grounded, and cheap. This is the part built to make an engineer lean in.

iOS client · SwiftUI + Liquid Glass
HealthKit spine · on-device Apple Speech · Sign in with Apple · Keychain
custom JWT (Bearer) · transcript text + aggregate snapshots — never raw HealthKit samples ↓
Dedicated Vercel backend · TypeScript · Hono
Auth middleware
Bearer → userId · custom JWT, not a hosted auth SDK
Nutrition pipeline
3-tier: seed DB → community cache → LLM estimate → write back
LLM gateway
complete() · object() · objectFromImage() — one interface, provider-swappable · use-case → model table · hard paid-tier gate · per-call cost meter
Memory assembler (~2,500 tokens)
L1 core profile + L2 rolling summary (always) · L3 pgvector top-K episodes · L4 SQL aggregates (numbers, never rows)
Lab / InBody PDF pipeline
TS text-extract → vision-LLM fallback → open key-value biomarkers vs optimal ranges
reads / writes ↓    ↑ background writes
Supabase Postgres + pgvector
Multi-tenant · RLS on · IPv4 session pooler · forward-only SQL migrations
scheduled workers ↑   Vercel Cron + Postgres-backed queue · summary regen · insight engine · history import · embedding backfill

A provider-agnostic multi-LLM gateway

One internal interface with adapters behind it, so the provider is a swap, not a rewrite. Every use-case points at a tier through a config table — any use-case can move to any model with no code change. JSON outputs are schema-validated; every call is metered for cost.

Use-caseTierModel
food.estimatecheapgemini-2.5-flash
food.nl_fallbackcheapgemini-2.5-flash
chat.advisorcapableclaude-sonnet-4-6
insight.enginecapableclaude-sonnet-4-6
lab.visionmaxclaude-opus-4-8

Representative routing. Model IDs are stored without date suffixes; tierFor(useCase) falls back to cheap for any unknown key. The default posture: the cheapest model that's good enough, each use-case independently upgradable.

A four-layer memory architecture

The moat isn't the model — it's what you feed it. A typical call assembles roughly 2,500 tokens of precisely-chosen context: cheap and deeply personalized at the same time.

1
Core profileAge, primary goal, current stats, known conditions. Tiny and stable.
~500 tokalways sent
2
Health summaryA rolling, AI-written “doctor's-notes” summary, regenerated by a background worker on new data.
~1,200 tokalways sent
3
Episodic memoryTimestamped events embedded in pgvector; the query retrieves only the top-K relevant episodes.
variableretrieved by similarity
4
Raw dataFull row-level data. SQL computes averages, trends and deltas — only those values enter the prompt.
0 toknever sent as rows

≈ 2,500 tokens assembled per call — the difference between an assistant that remembers you and one that re-meets you every time.

The grounding rule: SQL computes, the model narrates

Accuracy is the product. The model never sees raw rows — the database computes the numbers deterministically, and the model's only task is to explain them in plain language. Calorie math is Atwater-authoritative; matched foods are never recomputed by an LLM.

✕ Never
prompt = f"""
Here are 4,000 raw rows.
Please average the HRV,
find the trend, and
compute the deltas...
"""
✓ Always
-- SQL does the math
avg_hrv     = 68 ms
trend_14d   = +9%
delta_vs_60 = +26%

model: "narrate these
numbers, clinically."

Cost is a first-class constraint

Cost-consciousness is a product feature, enforced in the gateway itself. Cheap-by-default routing, a hard paid-tier gate the free tier never crosses, on-device transcription with no per-minute cost, and a shared community cache that makes marginal cost per user fall as the base grows.

Naïve routing — every call on a frontier model Costly
Cheap-by-default + hard gate + shared cache A fraction
  • Seed databases (USDA + Indian catalogue) mean most food lookups never call an LLM.
  • Shared community cache absorbs the long tail — cost scales sub-linearly with users.
  • On-device transcription is free and private; only text reaches the backend.
  • Hard paid-tier gate in the gateway — the free tier never reaches any model.

Native to the metal

iOS 26-only, on purpose — no fallback code paths, so it can use Apple's newest frameworks first-class.

SwiftUI + Liquid Glass .glassEffect()

A DesignSystem module of glass cards and buttons, built before any screen. iPhone-only, iOS 26 floor.

HealthKit HKStatisticsQuery

The spine of the app. Apple Health is the source of truth; energy is written then read back to avoid double-counting.

Apple Speech on-device

Continuous dictation with requiresOnDeviceRecognition. Free, private, on-device.

Custom JWT jose

Backend-issued access + rotating refresh tokens in the Keychain — no hosted auth URLs exposed to the client.

Vercel + Hono nodejs20.x

Serverless TypeScript, region-pinned, validated with Zod. The client never touches Postgres directly.

Postgres + pgvector Supabase

Multi-tenant with RLS as defense-in-depth. ~7,888 USDA + 502 Indian foods seeded.

How it was built

Solo. Spec-first. Agentically.

One person, building a real multi-user product with a single "project brain" — code, specs and planning committed together — driven agentically with Claude Code, against numbered tickets with a plan and a summary each.

310commits shipped
175tracked SOR tickets
~495backend tests, green
8,390+foods seeded

Specs are the source of truth

Behaviour is defined in specs before code exists; tests are written from the specs, never reverse-engineered from the implementation. Every feature ships against a numbered ticket — plan first, summary after.

Models chosen by real A/Bs — never assumed

Model selection is decided by running the real LLMs against a reference set and measuring. One estimation-tier A/B moved food macros from a pricey model to a cheap one on the evidence:

10-food macro A/B · error vs reference
gemini-2.5-flash → MAE 13 kcal/100g · ~1.9s
gemini-2.5-pro → MAE 21 kcal/100g · ~11.5s
result: ≥ as accurate, ~4× cheaper, ~6× faster
Design thinking

Four convictions, visible in every screen

01 — aesthetic

Liquid Glass, iOS-26-first

The number-one requirement was Liquid Glass fidelity — which is why it's native SwiftUI with an iOS 26 floor and no fallback code. A flowing figure that doubles as an “S” for শরীর — body — on pure black.

#8B5CF6 #6366F1 #0B0B0B #4ECB7D
02 — correctness

Evidence-first, accuracy as the USP

Deterministic-first everything. Atwater math is authoritative, matched foods are never recomputed by a model, and a failed LLM call becomes a clean error — never a fabricated zero-calorie card.

03 — discipline

Cost-consciousness as a feature

Cheap-by-default routing, a hard paid-tier gate, on-device transcription, and a cost meter on every model call. The architecture makes the cheap path the default path.

04 — posture

A clinical, not-hype voice

The system talks like a sports nutritionist who is also a data scientist. Reference ranges follow longevity and sports-medicine literature; the tone is centralized, versioned, and free of fluff.

Built with
SwiftSwiftUILiquid GlassHealthKit Apple SpeechSign in with AppleTypeScriptHono VercelVercel AI SDKZodjose SupabasePostgrespgvector GeminiClaudeXcode CloudTestFlight