ClinIQ
AI Diagnostics & Clinical Intelligence
The problem ClinIQ solves
Healthcare is reactive by design. Physicians see 40-60 patients daily with no system that connects the dots across years of fragmented lab reports, discharge summaries, medications, and wearable data. Critical deterioration goes undetected until it becomes an emergency.
ClinIQ+ fixes this by giving any physician, including a general practitioner in a district with no specialist access, the ability to upload any clinical document and instantly receive a structured patient profile, a 12-month risk forecast, real-time drug interaction checks, anomaly alerts measured against the patient's personal baseline (not population averages), and diagnostic hypothesis validation. All streamed in real time. All explainable. All in under 10 seconds per document.
It makes patient onboarding, longitudinal monitoring, medication safety review, clinical documentation, and specialist-grade risk forecasting faster, safer, and accessible to every physician regardless of their infrastructure.
Challenges I ran into
Building ClinIQ+ was technically ambitious across multiple dimensions simultaneously and produced several genuine engineering challenges that required non-trivial solutions.
Challenge 1: Streaming multimodal responses without breaking structured data extraction
The platform relies on Gemini 2.5 Flash for both streaming narrative output (the AI explanations physicians read in real time) and structured JSON extraction (the clinical data that populates charts, risk scores, and forecasts). These two requirements are fundamentally in tension streaming works beautifully for prose but produces malformed JSON when the response is interrupted mid-token. Our initial implementation broke the forecast visualization every time the SSE stream was interrupted by network latency, because a half-delivered JSON object would be passed to the parser and crash the component.
We solved this by implementing a dual-mode response architecture. For structured data endpoints, we send the full Gemini request with explicit JSON-only instructions and a schema, buffer the complete response server-side before returning it, and validate it against a Pydantic model before sending to the frontend. For narrative endpoints, we stream freely via SSE. The two modes never mix in the same request. This added latency to the structured endpoints but made the system reliable. We also added a JSON repair utility on the frontend that catches and attempts to patch common truncation errors as a last-resort fallback.
Challenge 2: Personal baseline anomaly detection without historical data on new patients
The core clinical insight behind our alert system is that anomalies should be measured against a patient's personal history, not population averages. A creatinine jump from 0.9 to 1.1 is clinically significant for that specific patient even though 1.1 is within normal range. However, new patients have no historical baseline they have one uploaded document. Comparing a single data point against itself produces meaningless alerts or no alerts at all.
We solved this with a tiered anomaly detection system. For patients with fewer than three historical data points, the system falls back to population-level reference ranges with a visible disclaimer that baseline is still being established. For patients with three to eight data points, we use a lightweight statistical model mean plus two standard deviations to set the personal threshold. For patients with more than eight data points, we apply a rolling window z-score calculation that weights recent readings more heavily than older ones. We also prompt Gemini with the available history and ask it to reason about whether a value is anomalous in context, using clinical knowledge to compensate for thin statistical data. The result is a system that is useful from the first document upload and becomes progressively more accurate as data accumulates.
Challenge 3: Multilingual voice command interpretation in a clinical context
Supporting voice input across eight Indian languages sounds straightforward with Google Cloud Speech-to-Text, but the clinical domain created unexpected complexity. Medical terminology behaves very differently across languages. Patients in Tamil Nadu refer to blood glucose as "sugar" and blood pressure as "pressure" both of which are too ambiguous for a direct clinical mapping without context. Drug names are almost universally known by brand names (Crocin, Glycomet, Ecosprin) rather than generic names (Paracetamol, Metformin, Aspirin), which are what the clinical database stores. Regional pronunciation variations for English medical terms caused consistent STT misrecognition even with the medical dictation model enabled.
We built a three-layer normalization pipeline that runs on every voice transcript before it reaches Gemini. The first layer maps the top 200 Indian brand names to their generic equivalents. The second layer maps regional colloquial health terms to their clinical equivalents across Hindi, Tamil, and Telugu. The third layer sends the normalized transcript to Gemini with a clinical context prompt that resolves remaining ambiguity using the patient's known conditions and medications as grounding context. This reduced voice command misinterpretation from an unacceptable rate during early testing to a reliable experience across all supported languages.
Challenge 4: D3 force graph performance with real-time data updates
The comorbidity web is a D3 force-directed graph that needs to update in real time as new patient data arrives and as the physician clicks nodes to explore interactions. Early implementations caused the graph to completely re-render and re-run the physics simulation on every data update, producing a jarring visual snap that made the feature feel broken rather than dynamic. With patients who had seven or more active conditions, the simulation also took several seconds to stabilize on initial load, during which the graph was visually chaotic.
Technologies used
