AI case study — Healthcare analytics

Natural-language analytics over millions of healthcare records — by repositioning the LLM as a data scientist that writes its own analysis code, instead of a retriever that loses the data.

OpenAI Code InterpreterPythonPrompt engineeringData visualization
100%data fidelity across millions of records
Visit live product (opens in new tab)
The challenge

What we walked into.

The client needed real insights from dozens of Excel files holding hundreds of thousands of rows each — millions of records in total. Queries like "inpatient data for Crohn's disease patients between 2012 and 2020" or "year-wise hospitalization trends" broke traditional RAG: context windows exhausted, vector search returned partial results, and aggregations came back wrong. For analytical healthcare work, incomplete answers are unusable.

What we built

The solution.

01

A code-first AI analytics architecture built on OpenAI's Code Interpreter instead of a RAG pipeline.

02

The model acts as a data scientist: it writes Python for filtering, aggregation, and statistical analysis, runs time-bound cohort studies, and generates precise charts and tables.

03

No vectorization, chunking, or semantic compression — queries over millions of records execute without information loss.

04

Hardened prompt strategies enforce deterministic, reproducible analysis and consistent chart formats.

05

Handles generative asks too: "generate 5 clinical case studies from this data" or "summarize long-term anomalies across years."

The results

What changed.

01

Processed millions of tabular healthcare records with no data loss or sampling errors.

02

Accurate year-wise and cohort analysis (e.g., 2012–2020 disease trends) that RAG pipelines could not reliably achieve.

03

Statistically accurate charts generated straight from raw data — no manual validation pass needed.

04

Work that previously needed analysts and BI tooling now happens through natural-language queries.

Next project

Letter of Credit Reader