Projects
Rainbone preview
Built at Hack the Valley 11 (October 2026)

Rainbone

A 3D stress test for bones, explained by AI agents: real research femur CT scans become finite-element models, and a five-stage LangGraph agent team explains the checked results in plain words for long-term-care teams.

The Problem

In long-term care, a resident's bone health usually becomes visible only after a fall has already turned it into an emergency. Care teams (nurses, CNAs, wellness directors and doctors) have charts and risk scores, but no way to see where a femur actually carries load, how it compares with a research cohort, or what that means in plain words. Any tool in this space also has to be honest about what it is: a research prototype cannot claim to diagnose or predict a fracture.

My Role

Full-stack, AI and performance engineer, #1 GitHub contributor on a team of 4 at Hack the Valley 11.

The Approach

  • Turned real research CT scans of the thighbone (the HFValid cohort, each with a recorded follow-up) into tetrahedral meshes and solved them offline with SfePy finite elements: 800 N on the femoral head across 60,819 tetrahedra and 17,361 nodes, rendered live in the browser with vtk.js.
  • Built Ask Rainbone as a five-stage LangGraph agent graph (triage, evidence, writer, critic, audit) with a conditional critic-to-writer retry edge, so every answer is grounded in checked evidence and reviewed before a care team reads it.
  • Ran the AI layer on the Gemini API with a resilient fallback chain (two Gemini models, a saved Gemini answer, Groq, then a deterministic template), per-model cooldowns and an output checker, so the app never shows a blank or unchecked answer.
  • Deployed the FastAPI and SfePy backend on Vultr Compute behind Caddy, with sha256-pinned facts and meshes in Vultr Object Storage, and logged every AI analysis to a Tiger Cloud TimescaleDB hypertable with a continuous aggregate for an auditable history.
  • Added a simulated compression test that presses the femur until assumed strain limits are reached, a lesion progression viewer, a printable simulation report, and a research-paper write-up of the method and the math.

Key Decisions

  • Kept the numbers deterministic and the language agentic: stress values come from the finite-element solve and pinned data files, and the agents only explain them, so every number on screen traces back to a file and a hash.
  • Chose LangGraph over a single chain because the critic needed to send drafts back to the writer: an explicit state graph makes that loop, and the audit step after it, visible and testable.
  • Wrote an optional C++23 boundary-extraction kernel with C++20, C++17 and NumPy fallbacks. It runs 15.5-16.1x faster than the NumPy path on the server without making the native build a hard dependency.
  • Held a strict honesty line for a clinical audience: the app is labelled a research prototype, never says it predicts or diagnoses, and quotes the cohort's published model estimate as the study authors' figure rather than its own.

Impact & Results

  • Live at rainbone.health: a landing page, a care-team dashboard, 3D stress and lesion viewers, Ask Rainbone, a printable simulation report and a research paper, deployed on Vercel and Vultr.
  • Agentic answers on Gemini behind a five-level fallback chain, a red-team prompt suite for Ask Rainbone, and an audit table of every AI analysis in Tiger Cloud.
  • Designed for long-term-care teams, the audience of PointClickCare's Catch It Early challenge.

The Stack

PythonFastAPISfePyNumPyC++23LangGraphGemini APIGroqNext.js 15React 19vtk.jsVultr ComputeVultr Object StorageTiger Cloud (TimescaleDB)Vercel

What I Learned

  • In a clinical setting the hard part of an AI product is the boundary, not the model: deciding what the agents may say, and making them cite pinned evidence, took more design than wiring up Gemini.
  • A fallback chain is a product feature: free-tier rate limits hit during the build, and the chain with cooldowns and saved answers kept the experience working.
  • Heavy physics belongs offline: solving the femur ahead of time and streaming the results kept the 3D views interactive, while the live work went to explanation.