Inspiration

Navigating online health information is overwhelming and risky — misinformation is rampant, search results are noisy, and patients often lack the context to interpret medical content. I wanted to create a trustworthy, fast, and intelligent Q&A layer for medical queries — one that combines the intelligence of large models with credible, medically vetted sources. MediQuery was born out of this vision: to democratize access to reliable health information by filtering the power of AI through trusted domain gates and reasoned, contextualized answers — all in real-time.

What it does

MediQuery is an AI-powered medical assistant that delivers reliable, accurate, and citation-backed answers to health-related questions using the Perplexity Sonar API. It classifies user questions into medical categories (like symptoms, treatments, drug info, etc.), filters search results to trusted health domains (e.g., Mayo Clinic, CDC, PubMed), and returns a thoughtful, chain-of-thought explanation with sources. Use case examples: “Can I take ibuprofen with paracetamol?” “What are the symptoms of vitamin D deficiency?” “What are the latest treatment options for long COVID?”

How I built it

FastAPI backend to serve the medical query interface Sonar API (via Perplexity) for chain-of-thought medical answers Custom classifier that routes questions to domain filters based on topic (e.g., clinical_research, drug_info) Trusted domain filters enforced via search_domain_filter for safer, evidence-based citations Response schema validation using pydantic and json_schema Environment-aware deployment model (future-ready for secure, on-prem healthcare environments)

Challenges I ran into

Sonar API limitation the source domain filters to only 10 was a bit of problem Deciphering through different pydantic versions I had to brush up UI coding, so used ChatGPT for some of it Setting up one docker compose across both frontend and backend was tricky

Accomplishments that I'm proud of

Created a fully working, scalable API in under couple of weeks with robust error handling and fallback logic Seamlessly blended Sonar's intelligence with domain-restricted querying to raise the trust bar Built an end-to-end bot for real-world testing and accessibility Crafted a deployment-ready architecture that can support clinical or institutional use cases securely

What I learned

The Sonar API is incredibly powerful when paired with domain-specific constraints — it’s like putting a brain in a safe sandbox Users respond much better when the answer includes citations — trust is everything in the current world Building responsible AI means not just what the model can say, but what it’s allowed to search

What's next for MediQuery

Integrating Chain-of-thought reasoning from Perplexity adds major value in high-stakes domains like medicine and as the next step we are planning to create an enterprise version by using sonar-deep-research and sonar-reasoning-pro which will help clinicians in real-time.

Please consider this for Best Health Project category as well

Built With

Share this project:

Updates