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.
- 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.
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.
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 |
- 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)
-
User asks a medical question (e.g., “What are early signs of heart disease?”).
-
The main agent decides whether to:
- Use RAG to retrieve answers from internal vector DB.
- Or invoke Google Search for current studies/articles.
-
Gemini generates a summarized, accurate response.
-
Agent tracks context for follow-up questions in multi-turn conversations.
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
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 |
- ⏱️ Avg. response time: ~2 seconds
- 🔍 Covers both factual and dynamic information
- 🧠 High multi-turn memory accuracy
- 🧹 Modular architecture for easy scaling and deployment
- ✅ No personal data storage unless configured
- ❌ Not a replacement for licensed medical professionals
- 🔍 Intended for education, awareness, and research
- 📜 Clinical API Integration (FDA, Healthline, etc.)
- 🔒 HIPAA-compliant patient support mode
- 🌍 Multi-language & voice assistant integration
- 📊 Dashboard for query analytics
- 🧠 Personalized document upload & QnA
Muhammad Abdullah CTO at BlueOrbitAi AI Engineer | Agentic Systems Developer | FastAPI Expert
📨 Contact: [email protected] 🔗 GitHub: MuhammadAbdullah95 📁 Project Repo: GitHub Link