Inspiration
We were inspired to build RareMatch by the staggering unmet need within the rare disease community: over 300 million patients worldwide are affected, yet 95% of these diseases have no approved treatments. Developing a new drug can take 10 to 17 years, making it economically unfeasible for small patient populations.
We recognized that drug repurposing—using existing, approved drugs for new indications—is the highest-leverage intervention available because these drugs already have established safety profiles and manufacturing. However, existing manual searches take hours or days, and current AI tools are prone to dangerous hallucinations, leaving a massive knowledge gap for physicians.
What it does
RareMatch is an AI-powered rare disease drug repurposing engine. It takes a rare disease name alongside patient-specific constraints (such as age, liver condition, or cardiac risk) and returns a ranked, safety-filtered list of drug candidates in seconds.
To ensure safety, the system outputs results using a strict GREEN, YELLOW, and RED traffic light system. GREEN indicates no flagged concerns, YELLOW flags issues like boxed warnings, and RED denotes contraindicated drugs. Crucially, RED drugs are never hidden—they are displayed at the bottom with a full explanation to prevent clinicians from accidentally prescribing a known danger.
How we built it
We architected RareMatch around three distinct pipelines to ensure safety and reliability: 1.Extract: We use Google Gemini 2.0 to read live NCBI PubMed abstracts and extract the broken biological pathway and its mechanism. 2.Match: We wrote 100% deterministic Python to map that mechanism against a curated JSON database of 26 hand-verified drugs across 14 pathways. This layer applies Gain-of-Function (GoF) and Loss-of-Function (LoF) direction rules to block drugs that would worsen the disease. 3.Safety Gate: We integrated the free OpenFDA API to fetch live drug labels, applying 9 priority-ordered safety rules to assign the final traffic light ranking.
Challenges we ran into
Our biggest challenge was solving the "Hallucination Problem" inherent in medical LLMs. If you ask an AI like Gemini, "What drug treats ALPS?", it will often produce a confident, plausible-sounding answer that is entirely fabricated. In medicine, a confident hallucination is much more dangerous than an honest "I don't know".
To solve this, we had to strictly isolate the AI's responsibilities. We designed the system so the AI is never used to name, suggest, or rank drug candidates. Instead, it is used exclusively for reading and structuring unstructured PubMed text, pushing all critical medical matching to deterministic code.
Accomplishments that we're proud of
We are incredibly proud of our zero-hallucination, safety-first architecture. We built a robust testing suite of 29 automated unit tests that cover inference, matching, and safety. These tests run in under 5 seconds and require no network access or API keys.
Specifically, we are proud of our "safety trap" implementation. We deliberately included Carbamazepine in our database to test Dravet Syndrome inputs. Our automated tests successfully prove that the deterministic engine assigns it a confidence score of 0 and flags it as a RED contraindication, ensuring our safety filter works exactly as intended.
What we learned
We learned that the safest way to deploy generative AI in healthcare is to constrain it heavily. Our biggest takeaway became the core design principle of the entire project: "AI reads the literature. Python decides the matches. Safety gates everything.". We also learned how to enforce controlled vocabularies on LLM outputs using structured JSON system prompts and strict Pydantic validators.
What's next for RareMatch
Moving forward, we plan to expand and deploy the platform: 1.Scale the JSON database to support over 100 drugs across 25+ pathways, which requires zero code changes. 2.Integrate ClinicalTrials.gov to surface active clinical trials for the matched drug candidates. 3.Implement drug combination analysis to flag synergistic or antagonistic drug pairs. 4.Deploy the application to Streamlit Community Cloud to provide a live, public demo URL for researchers and physicians.
Built With
- api
- python
- streamlit
Log in or sign up for Devpost to join the conversation.