Inspiration

300 million people live with a rare disease. The average time to a correct diagnosis is 5 years — and 40% of patients are misdiagnosed at least once along the way. We kept coming back to the same question: what if a clinician could surface the right evidence, the right guideline conflicts, and the right gaps in one place, at the moment they need it?

Pathora was built for that moment. Not to replace clinical judgment — but to support it when the presentation is ambiguous, the condition is rare, and the evidence is contested.

## What it does

DEMO LINK: https://cap.so/s/ms9yj0zh48pt36c

Pathora takes a patient presentation — described in plain clinical language — and returns a structured diagnostic intelligence report in seconds. That report includes:

  • Guideline Alignment — maps the presentation against major guideline sets (WHO, DSM-5, ICD-11, NICE, ACR) and shows where they agree, conflict, or remain contested, with a live consensus gauge
  • Evidence Map — rates each diagnostic criterion (Strong / Moderate / Weak / Contested) with explanations grounded in PubMed literature and PMID citations
  • Population Gaps — flags where the evidence base is weak for specific demographic groups (e.g. women, paediatric patients, non-white populations)
  • Differential Radar — ranks alternative conditions with visual priority bars, distinguishing features, and clinical rationale
  • Next Steps — specific, actionable investigative steps
  • Follow-up Questions — when the presentation is ambiguous, Pathora asks targeted clinical questions and reanalyses with the new context

Pathora never diagnoses. It surfaces uncertainty, flags contested criteria, and helps clinicians ask better questions.

## How we built it

The core pipeline: a clinician submits a presentation → we query PubMed's E-utilities API (esearch + efetch) to pull relevant abstracts → pass them alongside the presentation to Claude (Sonnet 4.6) with a structured system prompt that enforces a strict JSON schema → validate and render the report.

The frontend is Next.js 16 App Router with Tailwind CSS v4, rendered as a dark-mode clinical dashboard. Each section of the report has a purpose-built component — SVG consensus gauges, stacked evidence
bars, ranked differential charts, citation cards — designed to make dense clinical information scannable for busy clinicians.

We used a strict TypeScript schema throughout (PathoraReport) and validated Claude's JSON output before rendering, with fallback handling for edge cases in model responses.

## Challenges we ran into

Getting Claude to return valid, consistently structured JSON across diverse and ambiguous presentations was the core challenge. We had to carefully engineer the system prompt to enforce schema compliance, strip markdown code fences the model occasionally wraps around responses, and handle graceful defaults for optional fields like followUpQuestions.

Tailwind CSS v4 (shipped with Next.js 16) uses a new @theme {} CSS-native configuration — no tailwind.config.ts — which required us to rethink our theming approach entirely compared to documentation
and examples we were used to.

We also had to balance Claude's tendency toward confident-sounding language against Pathora's core design principle: never assert, always surface uncertainty.

## Accomplishments that we're proud of

The evidence map with inline PMID citations grounded in real PubMed abstracts. When Claude says a criterion has "Weak" evidence and cites PMID 34521234, that citation is real — pulled at query time from
PubMed's API and rendered as a linked reference card. That traceability matters in a clinical context.

The refinement loop — when Pathora detects genuine ambiguity and asks targeted follow-up questions rather than returning a low-confidence report — felt like the right way to handle uncertainty honestly.

## What we learned

Prompting for structured output at production quality is harder than it looks. A well-designed JSON schema in the system prompt is necessary but not sufficient — you also need output validation, fallback
handling, and a way to recover gracefully when models deviate. The pipeline we built treats Claude's response as untrusted input until it passes schema validation.

We also learned that clinical UX is a design problem as much as an engineering problem. Doctors need to scan, not read. Every section of the results dashboard was rethought through that lens — what does a clinician need to see in 10 seconds, and what do they drill into?

## What's next for Pathora

  • EHR integration — structured report export (FHIR-compatible JSON, PDF) so findings can be attached to patient records
  • Specialist routing — based on the differential and evidence gaps, recommend which specialist referral is most likely to advance the workup
  • Audit trail — every report versioned with the presentation, evidence sources, and model used, so clinicians can track how their thinking evolved
  • Condition-specific modules — deeper prompt tuning for high-burden ambiguous conditions: Long COVID, hEDS, POTS, and other under-researched presentations where diagnostic gaps are widest

Built With

  • claude-api-(anthropic)
  • next.js
  • pubmed-e-utilities-api
  • react
  • tailwind-css
  • typescript
  • vitest
Share this project:

Updates