Evidence-attached, trust-scored facility shortlists for Indian healthcare. Built for Challenge 04 "Data Legend" — Databricks × Hack-Nation, 6th Global AI Hackathon.
In India, a postal code can determine a lifespan. Families travel hours to a hospital only to find the ICU was a claim, not a capability. Referral Copilot helps a non-technical NGO planner answer one question — "where should this patient actually go?" — with an answer they can defend.
Type a location and a care need ("dialysis near Jaipur") and you get a ranked shortlist of facilities. Every candidate shows:
- Distance to the patient's location,
- the verbatim sentence from the facility's own record that supports the match (never paraphrased — citations are enforced as exact substrings),
- the data gaps we couldn't fill,
- a calibrated trust score with an uncertainty interval, and
- automatic consistency flags (e.g. "ICU" claimed with no critical-care evidence).
You can override any assessment with a note and save the shortlist — and it survives the session.
- Evidence, enforced in code. Every citation must be a verbatim substring of the source text, checked on every path — so a model can't hallucinate a capability into the results.
- Confidence without a ground truth. A deterministic, fully explainable trust score separates strong evidence from weak claims and reports how sure it is.
- It double-checks its own work. A rule-based validator penalizes internally inconsistent claims and shows why.
- A data desert is not a medical desert. Missing data is shown as a gap, never rendered as "no facilities."
A seven-stage pipeline — parse → geocode → retrieve → extract → trust → validate → rank —
over a medallion lakehouse built from ~10,000 facility records. It runs fully offline on the
bundled sample (BM25 retrieval, keyword extraction, SQLite), and transparently upgrades to
Databricks services when configured: Unity Catalog, Mosaic AI Vector Search, Foundation
Models, Lakebase, a Serverless SQL warehouse, and MLflow tracing — shipped as a Databricks App.
| Path | Purpose |
|---|---|
app/ |
Streamlit UI — search, ranked cards, map, saved shortlists |
copilot/ |
UI-free business logic (the pipeline stages), fully unit-tested |
notebooks/ |
Medallion data pipeline (runs locally and as Databricks notebooks) |
sql/ |
Databricks SQL artifacts (Lakebase schema, etc.) |
data/ |
Small seed data + reference lookups (large datasets are gitignored) |
tests/ |
pytest suite |
Requires Python ≥ 3.10.
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
ruff check . && pytest # lint + tests
streamlit run app/app.py # run the appThe app opens on the Referral tab. Click a preset (Dialysis near Jaipur / Emergency surgery near Patna) or enter your own location + care need, and hit Search. No API keys or network connection are required to run the demo.