Inspiration

Our inspiration stemmed from the challenge of fragmented and inaccessible health information. When faced with a symptom, users often turn to unreliable sources or overwhelm their doctors with poorly organized history. We saw a critical need for a secure, intelligent digital companion that could provide trusted, initial guidance and, most importantly, organize the user's health profile (symptoms, medications, history). The goal was to build a system that respects patient data privacy through strict security (RLS) while leveraging Agentic AI to bridge the gap between self-assessment and professional care.

What it does

The AI Medical Assistant is a comprehensive health management platform that provides:

Real-time AI Health Chat: Powered by Google Gemini (flash) and OpenAI GPT, it offers streaming, natural language consultations for immediate health inquiries.

Symptom & History Tracking: Users can securely log and manage their chronic conditions, medications, allergies, and family history.

Agentic Resource Access: Leveraging IBM watsonx Orchestrate, the AI is empowered with tools to query our secure database and external resources (like the Doctor Directory and Hospital Finder) to provide contextual, data-grounded answers.

Appointment Management: Scheduling and tracking of all medical visits.

How we built it

This project was built on a modern, robust architecture:

Frontend: Developed with React 18 and TypeScript, styled using Tailwind CSS for a fully responsive, intuitive user experience.

Backend (BaaS): We utilized Supabase, providing a scalable PostgreSQL database with essential features like Authentication and Row Level Security (RLS) to protect sensitive medical data.

AI Engine & Orchestration: The core AI logic runs on Deno Edge Functions for low-latency performance. We integrated Google Gemini for real-time consultation and used IBM watsonx Orchestrate to manage the Agentic flow, allowing the AI to effectively decide when and how to use the database and external tools to answer complex, data-dependent queries.

Team: The entire application, from secure RLS policies to the streaming AI interface, was successfully developed by our two-member team, "ai squad," demonstrating efficient technical execution.

Challenges we ran into

The primary challenge was ensuring both security and performance in a complex, agentic workflow.

RLS Integration with AI: Securely granting the AI access to only the currently authenticated user's private health data via the Edge Functions, without compromising the underlying RLS policies, required careful token management and architecture design.

Agentic Tool Definition: Accurately defining the tools for IBM watsonx Orchestrate—such as querying for a user’s current medications or allergies—and ensuring the language model reliably selects and executes those tools under various natural language prompts was a significant engineering hurdle.

Real-time Streaming: Maintaining low-latency, real-time streaming of AI responses while simultaneously invoking database tools within the orchestration pipeline was a technical feat requiring optimization of the Deno Edge environment.

Accomplishments that we're proud of

Successful Agentic Deployment: We successfully built and deployed a functional Agentic AI system using IBM watsonx Orchestrate that can interact with structured, private data (Supabase) to provide grounded answers.

Robust Security Model: Implementing Row Level Security (RLS) on all sensitive health tables (medications, allergies, etc.) and proving that the authentication flow successfully protects user data.

End-to-End Functionality: Delivering a fully integrated, responsive application that includes user authentication, live streaming chat, symptom logging, and external resource search.

Team Efficiency: Completing this complex, full-stack, and agentic solution with a small, two-person team.

What we learned

We gained invaluable, practical experience in Agentic AI design patterns and secure data integration. We mastered:

Tool-Use Orchestration: Understanding how to structure external tools for LLMs using IBM watsonx Orchestrate to ensure reliable grounding and execution.

Serverless Security: Deepened our knowledge of securing serverless functions (Deno Edge) that require elevated database access (to bypass RLS for public data or act on behalf of the user).

Full-Stack Type Safety: Successfully using TypeScript across the entire stack (React, Supabase, and Deno) significantly improved development speed and minimized runtime errors.

What's next for AI Medical Assistant

Our roadmap focuses on expanding the Agentic capabilities and impact:

Full Agentic Expansion: Deeper integration with IBM watsonx Orchestrate to enable advanced, multi-step actions like automatically scheduling a follow-up appointment or fetching medication details from an external pharmacy API.

Predictive Health Insights: Transitioning from reactive symptom tracking to proactive prediction of potential health issues based on longitudinal data analysis.

Wearable Data Integration: Connecting to health APIs (e.g., Apple Health, Google Fit) to provide even richer, more contextualized guidance based on biometric data.

I18n: Implementing internationalization to extend the secure, intelligent assistance to a global audience.

Built With

Share this project:

Updates