MedAi
Diagnose Smarter, Live Healthier.
The problem MedAi solves
π©Ί What is MedAI?
MedAI is an AI-powered healthcare assistant designed to help users quickly understand their symptoms and access reliable medical information. It uses advanced AI models to analyze user input and provide helpful insights related to possible health conditions, precautions, and general medical guidance.
π What Can People Use MedAI For?
1οΈβ£ Quick Symptom Analysis
Users can describe their symptoms (e.g., fever, headache, cough), and MedAI analyzes them to suggest possible conditions and provide basic medical insights.
This helps users:
- Understand what their symptoms might indicate
- Decide whether they should seek medical attention
- Get preliminary health information instantly
2οΈβ£ Instant Medical Information
MedAI acts as a medical knowledge assistant where users can ask questions such as:
- "What causes migraines?"
- "What are the symptoms of dengue?"
- "How to reduce fever at home?"
The AI provides clear explanations in an easy-to-understand format.
3οΈβ£ Early Awareness and Preventive Guidance
Many people ignore early symptoms due to lack of information. MedAI helps by providing:
- Possible health explanations
- Preventive tips
- Basic safety precautions
This can encourage users to take early action for their health.
4οΈβ£ 24/7 AI Health Assistant
Unlike traditional healthcare consultation which may require appointments, MedAI is available anytime and anywhere, allowing users to quickly get health-related insights.
π‘ How MedAI Makes Existing Tasks Easier
β‘ Faster Access to Health Information
Instead of searching multiple websites for medical information, users can get structured answers instantly from MedAI.
π§ Simplifies Medical Knowledge
Medical terms can be confusing. MedAI explains symptoms, diseases, and precautions in simple and understandable language.
β± Saves Time
Users can quickly understand their symptoms without spending hours researching online.
π Consolidated Medical Guidance
MedAI combines medical information, symptom analysis, and guidance into a single AI-powered platform.
β οΈ Important Disclaimer
MedAI is designed for educational and informational purposes only.
It does not replace professional medical advice, diagnosis, or treatment from a licensed healthcare provider.
Users should always consult a qualified doctor for serious medical concerns.
π Potential Impact
MedAI can help improve health awareness and accessibility to medical information, especially for people who need quick guidance before consulting a healthcare professional.
Challenges I ran into
π Challenges & Bugs Faced During Development
1οΈβ£ API Integration Errors
One of the biggest hurdles during the development of MedAI was integrating the AI model through the OpenRouter API. Initially, the application frequently returned "Server Error" responses when users tried to send messages to the AI chatbot.
π Problem
The issue occurred because:
- The API key was not correctly loaded from environment variables.
- The request headers and body format required by the OpenRouter API were slightly different from the default configuration.
This resulted in failed API requests and prevented the chatbot from generating responses.
π Solution
To fix this issue:
- The API key was moved to a
.envfile and accessed usingimport.meta.envin the React application. - Proper headers were added to the request, including:
AuthorizationContent-Type
- The request body was structured according to the chat completion format required by the AI model.
After correcting the API request format and environment variable configuration, the AI responses started working correctly.
2οΈβ£ Rendering AI Responses Properly
Another challenge was displaying the AI-generated responses in a clean and readable format.
π Problem
The AI often returned responses containing:
- Markdown formatting
- Bullet points
- Headings
Without proper rendering, these responses appeared as plain text, making them difficult to read.
π Solution
To solve this problem, the following libraries were integrated:
react-markdownremark-gfm
These libraries allowed the application to render AI responses with proper formatting, including lists, headings, and structured content.
3οΈβ£ Managing Chat State in React
Maintaining the chat history between the user and the AI was another technical challenge.
π Problem
Initially, new messages were not properly appended to the existing chat history, which caused messages to disappear or overwrite previous responses.
π Solution
This was solved by implementing React state management using the useState hook to store and update the message history dynamically. Each user message and AI response was pushed into a messages array, ensuring the chat conversation remained intact.
π― Key Learning
Overcoming these challenges helped improve understanding of:
- API integration with AI services
- Environment variable management in React (Vite)
- State management in React applications
- Rendering dynamic AI-generated content
These improvements ultimately made MedAI more stable, user-friendly, and reliable.
Tracks Applied (2)
Best Use of Gemini API
Major League Hacking
Best Hack Built with Google Antigravity
Major League Hacking

