Inspiration

The idea for this project was inspired by the growing need for accessible and accurate medical assistance. In many parts of the world, there’s a gap between patients seeking timely help and doctors being available for consultation. I wanted to create a solution that bridges this gap by leveraging AI to assist patients in understanding their conditions better, using past cases as a reference. The inspiration also came from my passion for both machine learning and web development, making this project a perfect blend of these interests.

What it does

The medical chatbot acts as a virtual assistant for patients seeking medical advice. It enables users to: Query symptoms or medical concerns. Access recommendations based on similar historical cases. Get responses generated by a state-of-the-art language model (Google Generative AI). Enhance their understanding of possible diagnoses, previous treatments, and related information. The chatbot provides empathetic and professional responses by leveraging a database of previous patient-doctor interactions, ensuring users feel supported and informed

How we built it

Backend Development: Used Flask to create APIs for handling user queries and returning AI-generated responses. Integrated Flask-CORS for secure communication between the frontend and backend. Database and Embeddings: ChromaDB was implemented to store historical medical conversations as vector embeddings. Embedded data was processed using Google’s embedding functions, enabling fast and accurate similarity searches. AI Integration: Google Generative AI (Gemini-pro) was utilized for its conversational capabilities. A custom prompt template was designed to pass user queries and historical data to the AI for context-rich responses. Environment and Configuration: Leveraged .env files to securely store sensitive API keys and configurations. Implemented robust error handling to ensure smooth execution and user experience.

Challenges we ran into

Database Integration: Initial setup and configuration of ChromaDB with persistent storage posed difficulties. Fine-tuning the database for optimal query performance required several iterations. Prompt Crafting: Designing prompts that led to accurate, empathetic, and relevant responses from the AI was a complex task. CORS Issues: Coss-origin requests from the frontend to the Flask API were blocked initially. Resolved by configuring Flask-CORS to allow specific origins and endpoints. Embedding Consistency: Ensuring embeddings were generated and queried consistently across sessions was challenging but essential for reliable results.

Accomplishments that we're proud of

Successfully integrated a cutting-edge language model (Gemini-pro) to deliver professional and empathetic responses. Built a scalable and efficient backend using Flask and ChromaDB. Designed a prompt template that leveraged historical medical conversations for context-aware AI outputs. Overcame technical hurdles like database configuration, CORS issues, and embedding errors to deliver a seamless experience.

What we learned

AI in Healthcare: Gained insights into how conversational AI can assist in medical decision-making while emphasizing empathy and accuracy. Prompt Engineering: Learned how to guide AI responses effectively using structured prompts and real-world data. Backend Optimization: Understood the importance of robust error handling and efficient database querying in real-time applications. Cross-Technology Integration: Mastered integrating different tools (Flask, ChromaDB, Google Generative AI) to build a cohesive system.

What's next for Untitled

Database Expansion: Add more diverse and comprehensive medical case data to improve AI outputs. Feature Enhancements: Enable multilingual support for users worldwide. Add voice input and output capabilities for better accessibility. Deployment: Host the system on a scalable cloud platform for global availability and reliability. Compliance and Testing: Ensure the system aligns with medical guidelines and undergoes rigorous testing for safety and accuracy. User Feedback: Gather insights from real users to continuously refine and improve the chatbot experience.

Built With

Share this project:

Updates