Winner Submission for the Elastic + Google Cloud Hackathon Challenge
Combining Elasticsearch hybrid search with Google Gemini AI for intelligent healthcare information discovery
Neural RX is an intelligent healthcare information discovery platform that makes finding medical information feel like having a conversation with a knowledgeable medical reference guide. By combining Elasticsearch's hybrid search capabilities with Google Gemini's generative AI, we've created an experience that's both precise and personal.
- π€ Conversational AI Interface - Ask health questions in plain language
- π Hybrid Search - Combines keyword + semantic matching across 12+ medical conditions
- π£οΈ Voice Input - Hands-free interaction using Web Speech API
- πΎ Export Chat History - Download conversations in PDF, Text, or JSON format
- β Bookmarks - Star important messages for quick reference
- π§ Context-Aware Conversations - Remembers previous questions for natural follow-ups
- β‘ Quick Actions - One-click access to 6 common health topics
- π Dark Mode - Beautiful UI that adapts to your preference
- βΏ Accessible - WCAG AA compliant with keyboard navigation
[Add screenshots or GIF demo here]
Try these sample queries:
- "What are the symptoms of diabetes?"
- "Tell me about treatment options for hypertension"
- "How is asthma diagnosed?"
- "What causes migraines?"
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Interface β
β ββββββββββββββββββββββββ βββββββββββββββββββββββββββ β
β β Chat Interface β β Search Results Panel β β
β β - Voice Input β β - Medical Cards β β
β β - Bookmarks β β - Symptoms & Treatmentsβ β
β β - Export Options β β - Severity Badges β β
β ββββββββββββββββββββββββ βββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Express.js Backend β
β ββββββββββββββββββββ ββββββββββββββββββββββββββββ β
β β Gemini AI β β Elasticsearch β β
β β - Entity Extractβ β - Hybrid Search β β
β β - Response Gen β β - 12 Health Conditions β β
β β - Context Aware β β - Multi-field Matching β β
β ββββββββββββββββββββ ββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- User asks a health question via chat or voice
- Gemini AI extracts medical entities from the query
- Elasticsearch performs hybrid search across healthcare database
- Search results provide context to Gemini AI
- Gemini generates an informed, conversational response
- UI displays both AI response and structured medical cards
- React 18 with TypeScript
- Tailwind CSS + Shadcn UI for beautiful healthcare design
- TanStack Query for data fetching and state management
- Wouter for lightweight routing
- Lucide React for icons
- Express.js server with TypeScript
- Elasticsearch (@elastic/elasticsearch) for hybrid search
- Google Gemini AI (gemini-2.5-flash) for conversational intelligence
- In-memory storage for chat history and analytics
- Elastic Cloud - Managed Elasticsearch deployment
- Google AI Studio - Gemini API access
- Web Speech API - Browser-native voice recognition
- Node.js 18+ and npm
- Elastic Cloud account (Sign up free)
- Google AI Studio API key (Get yours)
-
Clone the repository
git clone https://github.com/yourusername/neural-rx.git cd neural-rx -
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory:GEMINI_API_KEY=your_gemini_api_key_here ELASTIC_CLOUD_ID=your_elastic_cloud_id_here ELASTIC_API_KEY=your_elastic_api_key_here SESSION_SECRET=your_random_session_secret
-
Get Elasticsearch credentials
- Go to Elastic Cloud
- Create a new Deployment (not Serverless)
- Copy the Cloud ID
- Open Kibana β Stack Management β Security β API Keys
- Create an API key with full permissions
- Update
ELASTIC_CLOUD_IDandELASTIC_API_KEYin.env
-
Get Google Gemini API key
- Visit Google AI Studio
- Create a new API key
- Update
GEMINI_API_KEYin.env
-
Run the application
npm run dev
-
Open your browser
http://localhost:5000
The backend will automatically:
- Connect to Elasticsearch
- Create the
healthcare_conditionsindex - Seed 12 medical conditions
- Start serving on port 5000
Neural RX includes a curated database of 12 major medical conditions:
- Endocrine: Diabetes Type 2, Hypothyroidism
- Cardiovascular: Hypertension, Atrial Fibrillation
- Respiratory: Asthma
- Neurological: Migraine
- Musculoskeletal: Osteoarthritis, Rheumatoid Arthritis
- Mental Health: Depression, Generalized Anxiety Disorder
- Gastrointestinal: GERD (Gastroesophageal Reflux Disease)
- Renal: Chronic Kidney Disease
Each condition includes:
- Detailed description
- Common symptoms
- Treatment options
- Severity rating (Mild, Moderate, Severe)
- Medical category classification
Neural RX follows a healthcare-focused design philosophy:
- Color Palette: Medical blue primary (#0EA5E9) with carefully chosen accent colors
- Typography: Inter for body, JetBrains Mono for technical data
- Spacing: Consistent 2/4/6/8 unit system
- Accessibility: WCAG AA compliant with proper contrast ratios
- Responsive: Works beautifully on desktop, tablet, and mobile
See design_guidelines.md for complete design specifications.
Powered by the Web Speech API for hands-free interaction:
- Click the microphone icon in the chat input
- Speak your health question naturally
- Real-time speech-to-text transcription
- Visual feedback while recording
Save your conversations for future reference:
- PDF: Professional formatting with timestamps
- Text: Plain text format for easy reading
- JSON: Machine-readable format for data analysis
Mark important messages for quick access:
- Click the star icon on any message
- Bookmarks persist using localStorage
- Yellow star indicates saved messages
Pre-configured health topic cards for common queries:
- π Medication Information
- π©Ί Symptoms Checker
- β€οΈ Heart Health
- π§ Mental Health Support
- π₯ Nutrition Advice
- π₯ Health Checkups
neural-rx/
βββ client/
β βββ src/
β βββ components/ # React components
β β βββ ChatMessage.tsx
β β βββ ExportDialog.tsx
β β βββ QuickActions.tsx
β β βββ ScrollToBottomButton.tsx
β βββ contexts/ # React contexts
β β βββ BookmarksContext.tsx
β βββ hooks/ # Custom hooks
β β βββ useVoiceRecognition.ts
β β βββ useBookmarks.ts
β βββ lib/ # Utilities
β β βββ exportUtils.ts
β β βββ queryClient.ts
β βββ pages/ # Page components
β β βββ Home.tsx
β βββ types/ # TypeScript types
β βββ speech.d.ts
βββ server/
β βββ data/ # Healthcare dataset
β β βββ healthcare-conditions.ts
β βββ elastic.ts # Elasticsearch client
β βββ gemini.ts # Gemini AI integration
β βββ routes.ts # API endpoints
β βββ storage.ts # In-memory storage
β βββ index.ts # Server entry point
βββ shared/
β βββ schema.ts # Shared TypeScript types
βββ design_guidelines.md # Design system documentation
βββ replit.md # Project documentation
βββ README.md # You are here!
POST /api/chat- Send message, get AI response + search resultsGET /api/search?q={query}- Direct search without AIGET /api/chat/history/:sessionId- Retrieve chat history
GET /api/analytics/searches- Search analytics dataGET /api/health- Server and Elasticsearch status
The application includes comprehensive end-to-end tests covering:
- Chat functionality with AI responses
- Search results rendering
- Voice input interactions
- Bookmark persistence
- Export functionality
- Dark mode toggling
- Responsive design
Run tests:
npm testContributions are welcome! Please follow these steps:
- 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
Please ensure your code follows the existing style and includes appropriate tests.
This project is licensed under the MIT License - see the LICENSE file for details.
- Elastic for providing powerful hybrid search capabilities
- Google Cloud for Gemini AI's natural language understanding
- Replit for the development environment and hosting platform
- Shadcn UI for beautiful, accessible component primitives
- The open-source community for amazing tools and libraries
Project Maintainer: [Your Name]
Email: your.email@example.com
Project Link: https://github.com/yourusername/neural-rx
This project was built for the Elastic + Google Cloud Hackathon Challenge.
Challenge: Build the future of AI-powered search using Elastic's hybrid search and Google Cloud's generative AI tools.
What makes Neural RX special:
- β True hybrid search (keyword + semantic)
- β Context-aware AI conversations
- β Production-ready features (voice, export, bookmarks)
- β Beautiful, accessible healthcare UI
- β Real medical database with structured data
- β Sub-8-second response times
Built with β€οΈ for better healthcare information access
β Star this repo if you find it helpful!