A comprehensive AI-powered Medical Diagnosis System built with LangChain and Perplexity Sonar models, specifically designed for the Indian healthcare ecosystem. This system uses a collaborative team of specialized AI agents to assist doctors in clinical diagnosis, with support for multiple Indian languages and advanced medical image processing capabilities.
- 🗣️ Language Translator Agent (Bhasha): Translates symptoms from 10+ Indian languages
- 📊 Symptom Analyzer Agent (Lakshan): Structures patient symptoms clinically
- 📚 Medical Researcher Agent (Shodh): Searches current medical literature
- 🛡️ Risk Assessment Agent (Suraksha): Evaluates patient-specific risk factors
- 🧠 Diagnosis Aggregator Agent (Nidan): Combines insights into final diagnosis
- Supported Languages: Hindi, Marathi, Tamil, Telugu, Bengali, Gujarati, Kannada, Malayalam, Punjabi, Urdu
- Real-time Translation: Convert regional language symptoms to medical English
- Cultural Context: Understanding local medical expressions and terminology
- Supported Formats: X-rays, CT scans, MRI, Ultrasound, ECG reports
- AI Vision Analysis: Advanced image analysis for diagnostic findings
- OCR Technology: Extract text from scanned medical documents
- Conservative Approach: Always err on side of caution
- Emergency Detection: Prioritize identification of critical conditions
- Human-in-the-loop: Doctors make final decisions
- Audit Trails: Complete logging of diagnostic processes
- Frontend: Next.js 15, React 19, TypeScript
- UI Components: Radix UI, Tailwind CSS, Framer Motion
- AI/ML: LangChain, Perplexity Sonar Models
- Authentication: NextAuth.js
- Styling: Tailwind CSS with custom design system
- Clone the repository
git clone <repository-url>
cd curalink- Install dependencies
npm install --legacy-peer-deps- Set up environment variables
cp .env.example .envAdd your API keys to .env:
PERPLEXITY_API_KEY=your_perplexity_api_key_here
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret_here
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret- Run the development server
npm run dev- Open your browser Navigate to http://localhost:3000
- Sign up at Perplexity AI
- Get your API key from the dashboard
- Add it to your
.envfile
The system uses different Perplexity Sonar models for different agents:
- Large Model: For complex medical reasoning and research
- Small Model: For translation and quick analysis
- Huge Model: For the most accurate diagnosis aggregation
🏥 Medical Coordinator (Chief Agent)
├── 🗣️ Language Translator Agent (Bhasha)
├── 📊 Symptom Analyzer Agent (Lakshan)
├── 📚 Medical Researcher Agent (Shodh)
├── 🛡️ Risk Assessment Agent (Suraksha)
└── 🧠 Diagnosis Aggregator Agent (Nidan)
- Input Processing: Patient symptoms in any supported language
- Translation: Convert to medical English while preserving context
- Symptom Analysis: Structure symptoms by body system and severity
- Literature Research: Search current medical evidence
- Risk Assessment: Evaluate patient-specific factors
- Diagnosis Aggregation: Combine all insights into final recommendation
{
"symptoms": "मुझे पिछले 3 दिन से तेज़ बुखार, सिर दर्द और शरीर में दर्द हो रहा है।",
"language": "hindi",
"age": 28,
"gender": "female",
"location": "Delhi, India"
}System Output:
- Primary Diagnosis: Dengue Fever (85% confidence)
- Urgency Level: High
- Recommended Tests: Dengue NS1 Antigen, Complete Blood Count
- Clinical Notes: Classic dengue presentation during monsoon season
{
"symptoms": "நெஞ்சு வலி மற்றும் மூச்சு திணறல்",
"language": "tamil",
"age": 58,
"gender": "male",
"medicalHistory": ["diabetes", "hypertension"]
}System Output:
- Primary Diagnosis: Possible Myocardial Infarction (95% confidence)
- Urgency Level: Critical
- Emergency Protocol: Immediate cardiac evaluation required
Process medical diagnosis with AI agents
Request Body:
{
"symptoms": "Patient symptoms description",
"language": "hindi|tamil|english|etc",
"age": 30,
"gender": "male|female|other",
"location": "City, State",
"medicalHistory": ["condition1", "condition2"]
}Response:
{
"success": true,
"diagnosis": {
"primaryDiagnosis": {
"condition": "Condition Name",
"confidence": "85%",
"icd10Code": "A90"
},
"differentialDiagnosis": [...],
"urgencyLevel": "high",
"recommendedTests": [...],
"clinicalNotes": "...",
"agentInsights": {...}
}
}Health check endpoint for the medical system
- Data Encryption: End-to-end encryption of patient data
- HIPAA Ready: Compliance with healthcare privacy standards
- Role-based Access: Secure access control
- Audit Logging: Complete audit trails
- Anonymization: Patient data anonymized for research
| Language | Native Script | Code |
|---|---|---|
| English | English | english |
| Hindi | हिंदी | hindi |
| Marathi | मराठी | marathi |
| Tamil | தமிழ் | tamil |
| Telugu | తెలుగు | telugu |
| Bengali | বাংলা | bengali |
| Gujarati | ગુજરાતી | gujarati |
| Kannada | ಕನ್ನಡ | kannada |
| Malayalam | മലയാളം | malayalam |
| Punjabi | ਪੰਜਾਬੀ | punjabi |
| Urdu | اردو | urdu |
- Diagnostic Accuracy: >85% for common conditions
- Emergency Detection: >95% sensitivity for critical conditions
- Response Time: <5 seconds average processing
- Language Accuracy: >95% translation accuracy
- System Uptime: >99.9% availability target
npm run devnpm run build
npm startdocker build -t curalink .
docker run -p 3000:3000 curalink- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Email: support@curalink.ai
- Documentation: docs.curalink.ai
- Issues: GitHub Issues
- Perplexity AI for providing advanced language models
- LangChain for the multi-agent framework
- Indian Medical Community for insights and feedback
- Open Source Contributors for their valuable contributions