Inspiration
Diabetic patients are told to eat better but have no real incentive to follow through. Insurers pay billions in claims with zero visibility into patient behavior. We wanted to build the missing feedback loop between what you eat and what you pay.
What it does
Verdia tracks verified food purchases via the Knot API, scores each meal using K2 Think V2 + Tavily Agents and analyze photos using Gemma 4 31B, and computes a 7 day rolling metabolic risk score. That score directly adjusts the patient's insurance premium in real time. Patients see their score on a personal dashboard. Insurers see a live cohort heatmap ranked by risk.
How we built it
FastAPI backend with a scoring pipeline that calls Gemma 4 per food event, creates a summary and score with K2 + Tavily Agentic analysis, and computes an exponentially decayed rolling average, and publishes updates via Redis pub/sub to a Socket.IO layer. Next.js frontend with two role gated dashboards synced in real time. Clerk handles auth with patient and insurer roles. Knot API handles transaction ingestion.
Challenges we ran into
Mapping raw transaction descriptions to meaningful food scores took a lot of careful prompt engineering. Integration was also tricky: we were trying to use TransactionLink, but our SDK kept launching the CardSwitcher UI. Using the Knot Skill helped us fix this issue very quickly. On the model side, we needed strong LLM performance, so we initially used the unquantized Gemma 4 e4b in Ollama. That gave us solid capability, but it also caused memory issues and slow performance. Switching to a quantized version solved both problems: memory use dropped and the system ran much faster. Later, we found that the 31B param model was available at a high limit (1500), so we used the model for better visual classification.
Accomplishments that we're proud of
The end to end pipeline actually works in real time. Food purchase comes in, K2 and Gemma score it, rolling average updates, premium adjusts, both dashboards reflect it live within seconds. Also, it was very rewarding making a project that allows multiple people, who you would think have different motivations, work together and create better mutual situations.
What we learned
Verified data is everything. Self-reported food logs are unreliable. The moment you tie behavior to real financial transactions, the whole system becomes trustworthy.
What's next for Verdia
Deeper insurer analytics with claims prediction, and expanding beyond diabetes to other diet-related conditions like hypertension and heart disease.
Built With
- clerk-auth
- css
- fastapi
- gemini
- gemma
- google-gemini
- knot-api
- next.js
- postgresql
- python
- redis
- socket.io
- sqlalchemy
- supabase
- tailwindcss
- tavily
- typescript
Log in or sign up for Devpost to join the conversation.