Inspiration

I run HVAC contracts in Lagos. I have seen what traffic does to time-critical situations. In an emergency, families here do not ask "which hospital is best", they ask "which hospital can we reach, and will it even have power when we arrive?"

Medicine calls it the golden hour: the window after severe trauma or stroke where the right care decides everything. In Lagos traffic, that window closes fast. Ambulances routinely arrive at hospitals that have no ICU beds available, no specialist on duty, or a generator that is down. The patient is then referred onward, and the hour is gone.

GoldenHour exists to answer one question in seconds: given this emergency, right now, which Lagos hospital should this patient go to?

What it does

A dispatcher describes the emergency in plain language. GPT-5.6 triages its emergency type, urgency, red flags, required specialist, and requirements like blood bank or CT scanner.

The system then scores 12 Lagos hospitals on live capacity data: ICU beds, specialists on duty, generator status, blood bank, and traffic-adjusted ETA. The scoring function itself is generated by the model per emergency, a stroke weighs ETA and CT access differently than abdominal trauma weighs a surgeon and blood products.

It recommends a hospital, shows ranked alternatives, explains its reasoning, and is honest about risk. In one test, a stroke in Lekki was routed to a nearby hospital without a neurologist — because every neuro-capable facility was 35 minutes away and the system explicitly flagged the trade-off and told the dispatcher to confirm CT coverage while en route. That transparency is deliberate. Dispatch is judgment; the tool's job is to make the trade-offs visible.

How I built it

FastAPI backend on Railway with SQLite holding the hospital registry. React/Vite frontend on Vercel. GPT-5.6 handles triage and explanation; the hospital scoring function is model-generated per dispatch.

Challenges I ran into

Real ones, in one overnight session: a database schema/seed mismatch crash-looping the deploy; newer models rejecting the temperature parameter; reasoning tokens silently consuming the completion budget and returning empty explanations; and a schema mismatch where the generated scoring function looked for keys my data did not use, so no hospital ever got credit for having a trauma surgeon. Each one taught me something about building on frontier models: be explicit about your data schema in the prompt, and never let a silent fallback hide a failing API call.

Accomplishments that we're proud of

The system is live, end-to-end, on real infrastructure, not a local demo. Triage, model-generated scoring, and routing all run against a deployed backend, and every recommendation comes with visible reasoning.

Proudest single moment: watching it route a Lekki stroke case to a nearer non-specialist hospital because every neuro-capable facility was 35 minutes away and then flag that exact trade-off to the dispatcher instead of hiding it. It behaved like a tool for human judgment, not a black box.

I also built this while running an HVAC contracting company by day. The whole debugging session that got it production-ready happened overnight.

What we learned

Be explicit about your data schema when a model writes code against it. Our scoring function silently failed to credit hospitals for having trauma surgeons because the generated code guessed key names. One paragraph of schema in the system prompt fixed what looked like a logic bug.

Never let a silent fallback mask a failing API call. Our frontend showed a polished mock response while the real API failed for hours. Honest errors beat fake success.

Newer reasoning models change old assumptions: temperature parameters get rejected, and reasoning tokens can consume your entire completion budget and return an empty string. Budget generously and test the actual deployed path, not just localhost.

What's next

Real hospital data partnerships, WhatsApp-based capacity updates from hospital admins (Nigeria runs on WhatsApp), and expansion beyond Lagos. The hospital registry updating over WhatsApp is not hypothetical for me I already run a WhatsApp-based transport safety platform for my hometown, and the pattern transfers.

Built With

Share this project:

Updates