Skip to content
~/projects/metis$ cat README.md← projects

WIPsince 2026

METIS

B.Sc. thesis. Clinical AI backend deploying a Neural Thompson Sampling model (PyTorch) as a REST API for real-time treatment recommendations. Model inference, clinician feedback ingestion, and posterior updates are handled by a FastAPI service backed by PostgreSQL and Neo4j — with deterministic safety gates enforced at the API layer before any model output is returned.

  • Python
  • PyTorch
  • FastAPI
  • PostgreSQL
  • Neo4j
  • Next.js
  • React
The Metis similar-patients graph: matched historical cases laid out by treatment and outcome, with a per-treatment outcome rollup

The problem

Type-2 diabetes guidelines give general rules, but the best medication for a specific patient is often unclear: dozens of clinical features interact.

What was built

  1. A Neural Thompson Sampling contextual bandit (PyTorch) that recommends one of five therapies — Metformin, GLP-1 RA, SGLT-2i, DPP-4i, Insulin — with a calibrated confidence and a runner-up.
  2. A deterministic safety gate after the model that overrides contraindicated choices (for example Metformin below eGFR 30), with the pre-override choice kept for audit.
  3. A FastAPI service backed by PostgreSQL and a Neo4j cohort that finds the most similar historical patients.
  4. Clinician decisions (accepted or overridden) stored as feedback and replayed to update the model online.