Skip to content

MuhammadAbdullah95/Medical_AI_Assistant_agent_openai_sdk

Repository files navigation

🏥 Case Study: AI-Powered Medical Assistant — by BlueOrbitAi

🔍 Overview

The Medical AI Chatbot by BlueOrbitAi is a smart conversational agent designed to provide accurate, real-time, and contextual responses to medical queries. Using cutting-edge technologies like Google Gemini, LangChain, OpenAI’s Agents SDK, and RAG (Retrieval-Augmented Generation), it ensures users receive both trusted knowledge base information and fresh insights from the web via Google Search.


⚠️ The Problem

  • Traditional chatbots lack context-awareness and rely on static datasets.
  • Users demand real-time, reliable, and detailed health information.
  • Health queries are often multi-turn and require deeper reasoning.

💡 The Solution

We developed an agent-based AI chatbot that:

  • Retrieves context-rich responses using RAG.
  • Uses Google Search to fetch the latest medical knowledge.
  • Applies reasoning and memory to manage complex, multi-turn conversations.
  • Offers a clean, scalable API and development UI using Chainlit.

✨ Key Features

Feature Description
✅ Medical Query Handling General health Q&A via Gemini and embedded data
✅ Google Search Tool Fetches up-to-date online information
✅ RAG-Based Retrieval Retrieves relevant vector-embedded knowledge
✅ Multi-turn Context Remembers and builds on prior chat turns
✅ Custom Agent Tools Extends AI behavior with OpenAI Agents SDK
✅ FastAPI Backend Real-time, scalable, and secure API

⚙️ Tech Stack

  • Langchain – Tool orchestration, agent logic
  • Pinecone – Vector DB for fast similarity search
  • Google Gemini – Main LLM for intelligent responses
  • OpenAI Agents SDK – Tool-calling framework
  • Google Search API – Real-time data enrichment
  • FastAPI – Backend API service
  • Chainlit – Chatbot development UI (optional)

🧠 How It Works

  1. User asks a medical question (e.g., “What are early signs of heart disease?”).

  2. The main agent decides whether to:

    • Use RAG to retrieve answers from internal vector DB.
    • Or invoke Google Search for current studies/articles.
  3. Gemini generates a summarized, accurate response.

  4. Agent tracks context for follow-up questions in multi-turn conversations.


📂 Project Architecture

Medical_AI_Assistant_agent_openai_sdk/
├── app.py                  # Main backend application
├── retrievel_tool.py       # RAG-based vector retrieval
├── google_search.py        # Google search integration
├── src/openai_sdk/         # Agents and tools logic
├── data/                   # Embedded medical documents
├── .env                    # API keys and secrets
├── .gitignore              # Ignored files/folders
└── README.md               # Documentation

💬 Example Use Cases

User Query AI Response
“What are the symptoms of diabetes?” Summarized from embedded medical dataset
“Latest treatment for hypertension?” Uses Google Search for up-to-date research
“Do I need to fast for a cholesterol test?” Informs using Gemini’s contextual reasoning

📈 Results & Outcomes

  • ⏱️ Avg. response time: ~2 seconds
  • 🔍 Covers both factual and dynamic information
  • 🧠 High multi-turn memory accuracy
  • 🧹 Modular architecture for easy scaling and deployment

🔐 Security & Ethical Considerations

  • ✅ No personal data storage unless configured
  • ❌ Not a replacement for licensed medical professionals
  • 🔍 Intended for education, awareness, and research

🚀 Future Roadmap

  • 📜 Clinical API Integration (FDA, Healthline, etc.)
  • 🔒 HIPAA-compliant patient support mode
  • 🌍 Multi-language & voice assistant integration
  • 📊 Dashboard for query analytics
  • 🧠 Personalized document upload & QnA

👨‍💼 Author

Muhammad Abdullah CTO at BlueOrbitAi AI Engineer | Agentic Systems Developer | FastAPI Expert

📨 Contact: [email protected] 🔗 GitHub: MuhammadAbdullah95 📁 Project Repo: GitHub Link


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published