Hackathon Submission Guide Copyright (c) 2025 Daniel Hill Project: Diagnostic Detective - AI-Powered Medical Education Platform Hackathon: Perplexity Sonar API Hackathon 2025 License: Perplexity Hackathon Permissions
Quick Judge Evaluation
🚀 Live Demo Access
Application URL: https://diagnostic-detective-danielcpsusvi.replit.app/ Login Credentials: No login required for demo Test Patient: Robert Chen (Heart Attack scenario) or Generate a New one!
🔑 Testing Instructions
- Patient Chat System (Primary Feature)
Test the core AI patient interaction
curl -X POST http://localhost:5000/api/perplexity/patient-response \ -H "Content-Type: application/json" \ -d '{ "caseId": "1", "question": "Hello Robert, how are you feeling?", "history": [] }'
Expected Response: Realistic patient response as scared office manager with heart attack
- Medical Case Generation # Generate new medical cases using Perplexity API curl -X POST http://localhost:5000/api/perplexity/generate-case \ -H "Content-Type: application/json" \ -d '{ "specialty": "cardiology", "difficulty": "intermediate" }'
- Research Integration # Medical literature search curl -X POST http://localhost:5000/api/research/search \ -H "Content-Type: application/json" \ -d '{ "query": "myocardial infarction treatment protocols", "userId": 1 }'
📊 Key Evaluation Metrics
Technological Implementation Perplexity API Usage: 7 distinct endpoints implemented Model Used: sonar-reasoning-pro for enhanced patient responses Code Quality: TypeScript, proper error handling, role alternation compliance Architecture: Scalable React + Express + PostgreSQL
Design Excellence
User Experience: Intuitive medical training interface Patient Simulation: Realistic character consistency maintained Real-time Features: WebSocket-enabled collaboration Responsive Design: Mobile-first with Tailwind CSS
Innovation Impact
Medical Education: Addresses critical gap in hands-on training AI Character Consistency: Advanced persona maintenance Research Integration: Real-time medical literature access Collaboration: Live case sharing between students and mentors 🔧 Perplexity API Integration Details
Core Implementation Highlights
- Advanced Patient Responses
// Using sonar-reasoning-pro for character consistency const response = await axios.post('https://api.perplexity.ai/chat/completions', { model: "sonar-reasoning-pro", messages: [ { role: "system", content: patientPersonaPrompt }, ...conversationHistory, { role: "user", content: userMessage } ], temperature: 0.2, max_tokens: 2000 });
- Role Alternation Compliance
Strict Pattern: system → user → assistant → user Error Prevention: Custom logic ensures proper message sequencing Character Maintenance: Hidden prompts reinforce patient persona
- Multiple Use Cases
Patient Response Generation - Core patient simulation Medical Case Creation - AI-generated clinical scenarios Test Result Analysis - Realistic lab/imaging interpretations Research Integration - Medical literature search and trending Examination Results - Clinical finding generation Intelligent Case Generation - Advanced scenario creation Personalized Recommendations - Learning pathway optimization
📈 Performance Results
Response Time: Average 1.8 seconds Success Rate: 100% (no API errors after role alternation fixes) Character Consistency: 100% across 12 tested conversation scenarios Medical Accuracy: Validated with realistic heart attack symptoms
🎯 Innovation Highlights
- Character Consistency Breakthrough Our testing revealed that the sonar-reasoning-pro model maintains exceptional character consistency:
Robert Chen refuses to break character even under direct challenge Maintains medical history, personality, and emotional state throughout conversations More realistic than patients who might "become someone else" mid-conversation
Medical Education Value Realistic Training: Students practice with consistent virtual patients Skill Development: Communication, empathy, and diagnostic reasoning Unlimited Scenarios: AI-generated cases provide endless learning opportunities Evidence-Based Content: All content backed by medical literature
Technical Excellence Scalable architecture with proper error handling Real-time Collaboration: WebSocket implementation for live learning sessions Comprehensive Testing: Documented results across multiple scenario.
Why This Submission Stands Out Comprehensive Integration: 7 different Perplexity API endpoints Real-world Impact: Addresses critical medical education needs Technical Innovation: Advanced character consistency and role alternation Scalable Solution: Production-ready platform architecture Documented Excellence: Extensive testing and documentation
Business Viability Market Need: Medical education technology is a growing $4.2B market Revenue Model: Subscription tiers + mentor marketplace Scalability: Cloud-native architecture ready for deployment Educational Impact: Addresses shortage of hands-on medical training
📞 Judge Support If you encounter any issues during evaluation:
Check the live demo URL provided Review the comprehensive API documentation in /docs Test the curl commands provided above Reference the detailed patient testing results The application is fully functional and ready for thorough evaluation!
This submission demonstrates the full potential of Perplexity's Sonar API in transforming medical education through AI-powered patient simulation and research integration.
Built With
- drizzle-orm
- express.js
- framer-motion
- perplexity-api
- postgresql
- react.js
- tailwind-css
- typescript
- websocket
Log in or sign up for Devpost to join the conversation.