An intelligent, agentic AI healthcare assistant powered by AG2, Groq (LLaMA 3.3 70B), FastAPI, and Next.js.
Analyze symptoms Β· Decode lab reports Β· Check drug interactions Β· Get voice-guided health insights β all in real time.
MedHive AI is a full-stack, production-grade AI healthcare copilot that combines a multi-agent orchestration framework with retrieval-augmented generation (RAG), real-time voice interaction, and a premium Next.js 15 frontend to deliver a seamless personal health management experience.
Unlike single-model chatbots, MedHive coordinates 10 specialized AI agents β each expert in a different medical domain β through a Healthcare Coordinator that routes queries, aggregates results, and returns structured, verified health assessments.
β οΈ Disclaimer: MedHive AI is for educational and informational purposes only. It is not a substitute for professional medical advice, diagnosis, or treatment. Always consult a qualified healthcare provider.
| Feature | Description |
|---|---|
| π§ Multi-Agent AI | 10 specialized agents coordinated by AG2 β each an expert in their domain |
| π©Ί Symptom Analysis | Triage, risk scoring, and condition matching with confidence indicators |
| π¨ Emergency Detection | Automatic escalation for critical symptoms with immediate action guidance |
| 𧬠Lab Report AI | Upload PDF/image lab reports and get plain-language biomarker explanations |
| π Drug Interaction Check | Identifies dangerous medication combinations from your health profile |
| π Verified Medical Search | Real-time web search grounded in trusted medical sources |
| π RAG Knowledge Base | ChromaDB vector store with curated medical literature |
| ποΈ Voice Health Assistant | Whisper STT + Groq TTS β speak your symptoms, hear your analysis |
| π€ Patient Memory | SQLite-backed patient profiles with full health history |
| π Health Timeline | Visual longitudinal tracking of symptoms, vitals, and reports |
| π± Responsive UI | Premium Next.js 15 interface with Framer Motion animations |
| π Privacy First | All data stays local β no cloud storage without explicit consent |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Next.js 15 Frontend β
β Dashboard Β· Chat Β· Voice Β· Lab Reports Β· Medications Β· β
β Health Timeline Β· Patients Β· Settings β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β HTTP / REST API
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββ
β FastAPI Backend (Python) β
β β
β βββββββββββββββ βββββββββββββββββ βββββββββββββββββββββ β
β β /analyze β β/analyze-reportβ β/voice/voice-assistβ β
β β (Chat AI) β β (Lab PDF) β β (Whisper+TTS) β β
β ββββββββ¬βββββββ ββββββββ¬βββββββββ βββββββββββ¬ββββββββββ β
β β β β β
β ββββββββΌβββββββββββββββββΌββββββββββββββββββββββΌββββββββββ β
β β Healthcare Coordinator (AG2) β β
β β Routes Β· Orchestrates Β· Aggregates Β· Verifies β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Agent Pool β β
β β π§ Medical π¨ Emergency π Risk Assessment β β
β β π Web Search π Drug Inter. 𧬠Lab Report β β
β β β
Verification π Summary πͺ Coach π©ΊSymptom β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Services & Storage β β
β β ChromaDB (RAG) Β· SQLite (Patients) Β· Groq API β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Agent | Role |
|---|---|
| MedicalAgent | Primary symptom triage and medical knowledge base queries |
| EmergencyAgent | Detects life-threatening conditions, triggers emergency protocol |
| RiskAgent | Calculates composite risk scores (Low / Medium / High / Critical) |
| SymptomAgent | Extracts, classifies, and tracks symptom patterns |
| WebSearchAgent | Fetches real-time data from trusted medical sources (Mayo Clinic, NIH, etc.) |
| LabReportAgent | Parses and explains lab report biomarkers in plain language |
| DrugInteractionAgent | Analyzes medication combinations for dangerous interactions |
| VerificationAgent | Cross-validates AI output against evidence sources |
| SummaryAgent | Synthesizes multi-agent findings into a structured health assessment |
| CoachAgent | Provides actionable wellness recommendations and lifestyle guidance |
| Technology | Purpose |
|---|---|
| FastAPI | High-performance async REST API |
| AG2 (AutoGen v2) | Multi-agent orchestration framework |
| Groq API | Ultra-fast LLaMA 3.3 70B inference |
| ChromaDB | Vector database for RAG |
| Whisper | Speech-to-text transcription |
| SQLite + SQLAlchemy | Patient data persistence |
| LangChain | Document loading and text splitting |
| Uvicorn | ASGI server |
| Technology | Purpose |
|---|---|
| Next.js 15 | React framework with App Router |
| TypeScript | Type-safe development |
| Tailwind CSS v4 | Utility-first styling |
| Framer Motion | Fluid animations and transitions |
| Material Symbols | Google's icon system |
| Inter | Premium typography |
medhive-ai/
βββ backend/
β βββ agents/ # 10 specialized AI agents
β β βββ medical_agent.py
β β βββ emergency_agent.py
β β βββ risk_agent.py
β β βββ symptom_agent.py
β β βββ web_search_agent.py
β β βββ lab_report_agent.py
β β βββ drug_interaction_agent.py
β β βββ verification_agent.py
β β βββ summary_agent.py
β β βββ coach_agent.py
β βββ workflows/
β β βββ healthcare_coordinator.py # Agent orchestration
β βββ api/
β β βββ routes.py # /analyze endpoint
β β βββ report_routes.py # /analyze-report
β β βββ patient_routes.py # /patients CRUD
β βββ voice/
β β βββ voice_routes.py # /voice/voice-assistant
β β βββ stt.py # Whisper STT
β β βββ tts.py # Text-to-Speech
β β βββ whisperflow_service.py
β βββ rag/
β β βββ ingestion.py # Document ingestion
β β βββ retriever.py # Vector search
β βββ services/
β β βββ lab_report_service.py
β β βββ report_parser.py
β βββ models/ # SQLAlchemy ORM models
β βββ schemas/ # Pydantic request/response schemas
β βββ repositories/ # Database access layer
β βββ config/settings.py # App configuration
β βββ db/init_db.py # Database initialization
β βββ data/medical_docs/ # Medical knowledge base
β βββ chroma_db/ # ChromaDB vector store
β βββ outputs/ # Generated TTS audio files
β βββ uploads/ # Uploaded lab reports
β βββ main.py # FastAPI app entry point
β βββ .env.example
β
βββ frontend/
β βββ src/
β βββ app/
β β βββ dashboard/ # Health dashboard
β β βββ chat/ # AI chat interface
β β βββ voice/ # Voice assistant
β β βββ lab-reports/ # Lab report analyzer
β β βββ medications/ # Drug interaction checker
β β βββ health-timeline/ # Health history
β β βββ patients/ # Patient management
β β βββ settings/ # App settings
β βββ components/
β βββ Sidebar.tsx # Navigation sidebar
β βββ ui/ # Reusable UI components
β
βββ img/ # Screenshots
βββ README.md
- Python 3.11+
- Node.js 18+
- A free Groq API key
git clone https://github.com/Dakshin10/medhive-ai.git
cd medhive-aicd backend
# Create and activate virtual environment
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # macOS/Linux
# Install dependencies
pip install -r requirements.txt
# Configure environment
copy .env.example .env # Windows
# cp .env.example .env # macOS/Linux
# Edit .env and add your Groq API key
# GROQ_API_KEY=your_key_here
# MODEL_NAME=llama-3.3-70b-versatile
# Initialize the database
python -c "from db.init_db import init_db; init_db()"
# Start the backend server
uvicorn main:app --reloadThe API will be running at http://localhost:8000
Interactive API docs: http://localhost:8000/docs
cd frontend
# Install dependencies
npm install
# Start the development server
npm run devThe frontend will be running at http://localhost:3000
Create backend/.env from the example:
# Required
GROQ_API_KEY=your_groq_api_key_here
# Model Selection (default: llama-3.3-70b-versatile)
MODEL_NAME=llama-3.3-70b-versatileGet your free Groq API key at console.groq.com β inference is blazing fast (700+ tokens/sec) and free to start.
| Method | Endpoint | Description |
|---|---|---|
POST |
/analyze |
Main health query β routes through all agents |
POST |
/analyze-report |
Upload & analyze lab report PDF |
POST |
/voice/voice-assistant |
Voice query: audio in β transcript + AI response + audio out |
GET |
/patients |
List all patients |
POST |
/patients |
Create patient profile |
GET |
/patients/{id} |
Get patient details |
PUT |
/patients/{id} |
Update patient record |
DELETE |
/patients/{id} |
Delete patient |
GET |
/health |
API health check |
GET |
/docs |
Interactive Swagger UI |
curl -X POST http://localhost:8000/analyze \
-H "Content-Type: application/json" \
-d '{"message": "I have been having chest tightness, shortness of breath, and fatigue for 3 days"}'Response:
{
"status": "SUCCESS",
"assessment": {
"symptoms": ["chest tightness", "shortness of breath", "fatigue"],
"risk_level": "HIGH",
"possible_conditions": ["Cardiac event", "Pulmonary embolism", "Severe anemia"],
"recommendations": ["Seek immediate medical attention", "Avoid strenuous activity"],
"confidence_score": 87,
"evidence_sources": ["https://www.mayoclinic.org/..."]
}
}curl -X POST http://localhost:8000/analyze-report \
-F "file=@CBC_report.pdf"User speaks β Whisper STT β Text transcript
β
Healthcare Coordinator (10 agents)
β
Structured JSON assessment
β
Groq TTS β Audio response file
β
Frontend plays audio + displays rich assessment card
- Cardiology β Heart rate, blood pressure, cardiac symptoms
- Endocrinology β Diabetes (HbA1c, glucose), thyroid function
- Hematology β CBC, hemoglobin, platelets, anemia indicators
- Lipidology β LDL, HDL, triglycerides, cardiovascular risk
- Hepatology β Liver enzymes (ALT, AST), metabolic panel
- Nephrology β Kidney function (creatinine, BUN, GFR)
- Pulmonology β Respiratory symptoms, oxygen saturation
- Pharmacology β Drug-drug interactions, supplement safety
- Emergency Medicine β Triage and critical condition detection
- Preventive Medicine β Wellness coaching and lifestyle optimization
- β All data processed locally β nothing sent to external servers except LLM inference
- β No patient data stored in the cloud
- β
.envsecrets are never committed to version control - β CORS configured for local development
- β SQLite database stays on your machine
β οΈ For production use, add authentication, HTTPS, and proper secrets management
- π User authentication (JWT / OAuth2)
- π Multi-language support (Hindi, Spanish, French)
- π± React Native mobile app
- π©Ί FHIR / HL7 integration for EHR import
- π Advanced analytics dashboard with charts
- π Push notification for medication reminders
- π€ Doctor-patient secure messaging
- 𧬠Genomics data integration
- βοΈ Optional cloud sync with end-to-end encryption
Contributions are welcome! Here's how to get started:
# Fork the repo and clone it
git clone https://github.com/your-username/medhive-ai.git
# Create a feature branch
git checkout -b feature/your-amazing-feature
# Make your changes, then commit
git commit -m "feat: add amazing feature"
# Push and open a Pull Request
git push origin feature/your-amazing-featurePlease follow Conventional Commits and ensure all new agents include proper error handling.
This project is licensed under the MIT License β see the LICENSE file for details.
| Tool | Purpose |
|---|---|
| AG2 (AutoGen) | Multi-agent orchestration |
| Groq | Ultra-fast LLM inference |
| Meta LLaMA 3.3 | Foundation language model |
| OpenAI Whisper | Speech recognition |
| ChromaDB | Vector database |
| FastAPI | Python web framework |
| Next.js | React meta-framework |
| Framer Motion | UI animations |









