Inspiration
Healthcare coordinators and NGO teams often have to make referral decisions with incomplete, messy facility records. A facility may claim to offer emergency care, surgery, dialysis, ICU, or maternity services, but the evidence behind those claims is scattered across free-text descriptions, specialties, procedures, equipment, and capability fields.
We built SOS: Source of Support because referral decisions should not feel like guesswork. Our goal was to help a non-technical coordinator ask a simple question, such as “dialysis near Jaipur” or “emergency surgery near Patna,” and get back a shortlist that shows not only where to go, but why each facility was recommended.
What it does
SOS is a referral copilot for healthcare facility search across India.
A user enters a natural-language care need and location. The app then:
- Interprets the request into a care need, city, clinical keywords, preferences, and search radius
- Searches a Databricks Gold facility index built from the provided dataset
- Ranks nearby facilities using evidence relevance and distance
- Shows matched evidence from specialties, standardized services, parsed capabilities, and descriptions
- Displays uncertainty signals such as confirmed, approximate, uncertain, or unresolved location
- Avoids claiming facts that are not in the dataset, such as ratings or equipment age
For example, if a user asks for “emergency surgery near Patna,” SOS returns nearby facilities with evidence such as emergency medicine, trauma surgery, emergency room services, or parsed emergency capabilities.
How we built it
We built the project in two layers: a Databricks data pipeline and a Streamlit Databricks App.
First, we created a Gold table called workspace.default.sos_facility_index. Starting from the provided facility dataset, we joined core facility identity, contact, address, coordinates, doctor counts, capacity, descriptions, and location enrichment with AI-standardized evidence tables.
We used Databricks ai_query to standardize noisy healthcare fields:
- Specialties were normalized into cleaner medical specialty names
- Procedures and services were standardized into medical service categories
- Equipment was standardized into medical equipment categories
- Facility capabilities were parsed into structured clinical and operational claims
Then we joined those enriched fields with location-confidence data, including district, state, verified postcode, and coordinate confidence. This gave the app a single searchable facility index while preserving the evidence behind each recommendation.
On top of that, we built a Streamlit app using Databricks SQL. The app uses an LLM planner to convert user text into structured search inputs. It then queries the Gold table, filters candidates by geography, computes distance with the Haversine formula, ranks facilities by relevance, and displays an evidence-attached shortlist.
For distance, we used the standard Haversine approach:
$$ d = 2r \arcsin\left(\sqrt{\sin^2\left(\frac{\Delta \phi}{2}\right) + \cos(\phi_1)\cos(\phi_2)\sin^2\left(\frac{\Delta \lambda}{2}\right)}\right) $$
where (r) is Earth’s radius, (\phi) is latitude, and (\lambda) is longitude.
Challenges we ran into
The biggest challenge was that the data was real-world messy. Useful signals existed, but they were noisy, repetitive, and unevenly structured. A single facility might have capabilities buried in long text, duplicated specialties, inconsistent spellings, or broad claims that needed careful interpretation.
Another challenge was avoiding misleading matches. For example, a user who says “I broke my hand and require surgery near Bangalore” needs orthopedic fracture care, not a dental clinic that happens to mention oral surgery or bone grafting. We added query-specific relevance scoring so orthopedic searches prefer orthopedic, fracture, trauma, and hand-surgery evidence while downranking dental-only matches.
We also had to communicate uncertainty honestly. The app shows location-confidence badges and explicitly tells users when requested preferences, such as good ratings or newer equipment, are not available in the dataset. We chose not to invent or infer those details.
Accomplishments that we're proud of
We’re proud that SOS combines a serious data-cleaning pipeline with a simple user workflow. The app is not just a search box over raw text; it searches an AI-enriched Gold table built from standardized specialties, services, equipment, capabilities, and location enrichment.
We’re also proud that each recommendation is evidence-attached. Users can see why a facility appeared in the shortlist, whether the location is trustworthy, and which claims are backed by facility data.
Most importantly, SOS keeps a clear boundary between evidence and uncertainty. It helps users make better decisions without pretending the dataset is cleaner or more complete than it really is.
What we learned
We learned that trustworthy healthcare referral is not only a search problem. It is also a data-readiness, evidence-ranking, and uncertainty-communication problem.
LLMs were useful in two different ways: first, to standardize messy facility data during pipeline creation, and second, to interpret natural-language user queries in the app. But we also learned that LLMs need constraints. SOS treats the facility dataset as the source of truth and uses the model only to structure inputs or normalize claims.
We also learned that evidence design matters. A recommendation becomes much more trustworthy when the user can see the exact specialty, service, capability, or description that caused the match.
What's next for Referral Copilot
Next, we want to add persistence features so coordinators can save shortlists, add notes, record overrides, and revisit decisions later. This would turn SOS from a one-time search tool into a lightweight referral workspace.
We also want to add stronger trust scoring by evidence type, expose source URLs, support map-based views, and let teams compare care access across districts or states. Over time, Referral Copilot could help NGOs and healthcare planners build a reusable, evidence-backed referral knowledge base.
Built With
- aigateway
- databricks-app
- llm
- notebook
- python
- streamlit
Log in or sign up for Devpost to join the conversation.