Trialify: AI-Powered Clinical Trial Matching
Inspiration
The inspiration for Trialify came from the outstanding issues in healthcare systems nationwide. Many software tools used by HCPs are outdated or require endless manual parsing and typing. Additionally, we noticed that patients trying to match to clinical trials suffered with anxiety and high concern as these studies could appear unreliable and unsafe. We realized that if we could apply AI to streamline this one critical task, we could make a real difference for countless patients and their families.
The Problem
For doctors, finding the right clinical trial for a patient is a critical but daunting task. It involves hours of manually sifting through dense government databases like ClinicalTrials.gov and academic journals, a process that is both inefficient and prone to human error. This crucial delay can mean missed opportunities for patients with serious conditions, where timely access to innovative treatments can make all the difference. The existing process is a significant bottleneck, taking valuable time away from patient care.
Our Solution
Trialify is an AI-powered assistant designed to eliminate this bottleneck. It transforms the search for clinical trials from hours of manual labor into a matter of seconds. By intelligently parsing a doctor's notes or a live conversation with a patient, Trialify identifies key medical data and uses it to query the vast ClinicalTrials.gov database. It then presents a clear, concise summary of the top 3 most relevant trials, empowering doctors to make informed decisions swiftly.
How It Works
Our system is built on a simple yet powerful three-part workflow:
- The Input (What the Doctor Does): Doctors can either use an interactive form to input key patient data—such as diagnosis, age, and specific biomarkers—or utilize our voice AI feature. This allows Trialify to parse a live conversation between the doctor and patient to extract the necessary information seamlessly.
- The Brain (The Mastra Agent): This is the core of Trialify. We've developed a sophisticated agentic system using the Mastra Agent Framework with five specialized agents. The system reads and understands the input, intelligently searches and filters the ClinicalTrials.gov database via its API, and then analyzes the results to generate a ranked summary of the most promising trials, complete with justifications for each match.
- The Output (What the Doctor Sees): The result is a clean, user-friendly report displaying the top 3 recommended trials. The report includes crucial details such as the trial's purpose, eligibility criteria, and location, all presented in an easy-to-digest format.
What We Learned
This hackathon was a huge learning experience. We dove deep into the complexities of medical data, learned how to effectively interact with the massive ClinicalTrials.gov API, and honed our skills in building and orchestrating multi-agent systems using the Mastra framework. Most importantly, we learned how to design a user interface that could present complex information to medical professionals in a simple, intuitive way. Tailoring your software experience with respect to the audience is incredibly important, and for health domains, there are many constraints.
How We Built It
We started by mapping out the user journey for a busy doctor. Simplicity and speed were our top priorities. We built the front and back end using Next.js for a fast, modern user experience. The core of our project was designing the multi-agent system with the Mastra framework. We broke down the problem into distinct tasks and assigned each to a specialized AI agent: one to parse patient data, one to formulate API queries, one to execute the search, one to filter the results, and a final one to synthesize and summarize the findings. Rigorous testing with Postman ensured our API integrations were solid and reliable.
Tech Stack
- Frontend & Backend: Next.js
- API Testing: Postman
- Data Source: ClinicalTrials.gov API
- Agentic System: Mastra Framework with 5 agents, powered by the OpenAI API.
Challenges We Ran Into
Our biggest challenge was dealing with the incredibly diverse patient population that we could encounter. Medical conditions and issues come in so many different forms. Furthermore, the actual biological statistics that are relevant to each patient completely varies (Ex. insulin levels matter far more for a patient with diabetes than for one with severe depression). We had to develop a robust filtering and ranking algorithm to ensure that the top 3 results were truly the most relevant and promising for the patient. Ensuring the Mastra framework was broad and open-minded in its processing was essential to cater the software to each patient.
What's next for Trialify
- Extending trials database: Expanding the database of searchable clinical trials is the single most valuable and important expansion that will enabled more patients to get matched and save more time/money for HCPs
- Developing direct connections with Clinical Research Organizations (CROs) to further minimize dropout since it direct connections will lead to more accurate matching
Built With
- mastra
- next.js
- node.js
- postman
- rag
- typescript

Log in or sign up for Devpost to join the conversation.