Multi-Agent Medical Research Assistant
Transform 20 hours of medical research into 20 seconds of intelligent conversation
MedSearch AI is an intelligent medical research assistant built for the AI Accelerate Hackathon (Elastic Challenge). It leverages multi-agent orchestration to help healthcare professionals find, analyze, and synthesize medical research in seconds. The system combines Elasticsearch's hybrid search capabilities with Google Cloud's Vertex AI to deliver context-aware, citation-backed medical insights.
Healthcare professionals and researchers face significant challenges when conducting medical research:
- Information Overload: Over 1.5 million new medical articles published annually across thousands of journals
- Time-Consuming Research: Traditional literature review takes 15-20 hours per topic
- Fragmented Data Sources: Information scattered across PubMed, ClinicalTrials.gov, FDA databases, and more
- Lack of Context: Difficulty connecting research findings with clinical trials and drug information
- Citation Verification: Manual verification of sources is tedious and error-prone
- Outdated Search Tools: Traditional keyword search misses semantically related content
Impact: Delayed medical decisions, missed research connections, and inefficient use of healthcare professionals' time.
MedSearch AI transforms medical research through intelligent multi-agent orchestration:
- Intelligent Query Understanding - AI-powered query analysis identifies research intent and required data sources
- Multi-Agent Orchestration - Specialized agents work in parallel to search PubMed, clinical trials, and drug databases
- Hybrid Search - Combines semantic understanding (vector search) with keyword precision (BM25)
- Real-time Synthesis - Streams comprehensive answers with citations in under 3 seconds
- Citation Verification - Every claim is backed by verifiable sources with confidence scores
- Conversation Memory - Maintains context across multiple queries for deeper research
- π₯ Submission Video(β€3 minutes) : Demo Video
- π Live App: https://medsearch.mohankrishna.site/
- π Technical Details: TECHNICAL_DETAILS.md
- π€ Contributing Guide: CONTRIBUTING.md
- π οΈ Setup Guide: SETUP.md
- π€ Multi-Agent Orchestration - Specialized agents for Research, Clinical Trials, and Drug Information
- π Hybrid Search - Combines semantic (vector) and keyword (BM25) search with optional AI-powered reranking
- β‘ Real-time Streaming - WebSocket-based streaming responses
- π Citation-Backed - Every claim includes verifiable sources
- π― High Accuracy - 95%+ citation accuracy with confidence scores
- π Fast - Sub-3-second response time with Redis caching
- π Monitoring - Elastic APM integration for performance tracking (optional)
- π Resilient - Graceful degradation with fallback mechanisms
- PubMed - 1k+ recent medical articles (2020-2024)
- ClinicalTrials.gov - 500+ active clinical trials
- FDA Drugs - 200+ approved drugs with interaction data
- Open the live app: https://medsearch.mohankrishna.site/
- Login with demo credentials:
- Email: demo@medsearch.ai
- Password: Demo@123
- Enter a query (examples):
- "What are the latest treatments for Type 2 diabetes in elderly patients?"
- "what is Dapagliflozin in Heart Failure with Preserved Ejection Fraction (DELIVER)?"
- "metformin side effects in elders?"
- "Compare GLP-1 vs SGLT2 for T2D in CKD stage 3?"
- Observe streaming updates (research β clinical β drug β synthesis) in a few seconds.
- Verify the final answer includes citations; expand them to view titles, journal/phase/status, and dates.
- Ask a follow-up question to see conversation context retention.
- Edge case (limited evidence): try a very narrow query; you should still receive partial, honest output with clear limitations.
- Reliability: even if Elasticsearch is temporarily unavailable, the system returns curated mock results so youβll still see synthesized answers and citations.
How these two platforms directly helped this project ship fast with quality:
- Elasticsearch
- Hybrid retrieval (BM25 + vector) delivered strong precision and semantic recall for medical content
- Per-source indices (PubMed, ClinicalTrials, Drugs) enabled specialized scoring and filters (dates, phases, study types)
- Simple mappings and stable APIs let us iterate quickly from prototype to production
- Enabled future growth: same query model scales from local dev to larger clusters without code changes
- Google Cloud (Vertex AI + Compute Engine)
- Vertex AI gemini-embedding-001 powered our semantic search vectors with low latency and great quality
- Gemini Flash enabled fast synthesis and utility prompts (routing, summarization), keeping responses concise and cited
- Service accounts + IAM kept secrets and access scoped properly without custom infra
- Compute Engine VM hosted our stack reliably; Nginx terminated TLS and routed REST + WebSocket securely
1. Hybrid Search Architecture (Elasticsearch)
- BM25 + Vector Fusion: Combines keyword precision with semantic understanding using configurable weights (default: 70% semantic, 30% keyword)
- Per-Source Indices: Separate indices for PubMed, ClinicalTrials.gov, and FDA drugs with specialized mappings and filters
- Dense Vector Fields: 768-dimensional embeddings from Vertex AI gemini-embedding-001 for semantic search
- Advanced Filtering: Date ranges, study phases, trial status, drug approval status with Elasticsearch query DSL
2. AI-Powered Reranking (Google Vertex AI)
- Gemini-Based Scoring: Optional LLM reranking using Gemini Flash to score top-k results (default: 10) for relevance (0.0-1.0)
- Per-Agent Application: Applied independently to research, clinical trials, and drug results before synthesis
- Smart Fallback: Gracefully falls back to original Elasticsearch ranking on errors
- Cost Control: Configurable via
VERTEX_AI_RERANK_ENABLEDflag with adjustable top-k parameter
3. Application Performance Monitoring (Elastic APM)
- Transaction Tracing: Automatic instrumentation of FastAPI endpoints and multi-agent workflow
- Error Tracking: Captures exceptions with full stack traces and context
- Performance Metrics: Response times, throughput, and service dependencies visualization
- Configurable Sampling: Adjustable transaction sample rate (default: 10%) for cost control
- Kibana Integration: Real-time dashboards for monitoring application health
4. Intelligent Caching Strategy (Redis + Vertex AI)
- Embedding Cache: Stores recent query embeddings to reduce Vertex AI API calls and latency
- Search Result Cache: Caches frequently asked queries with TTL for instant responses
- LRU Eviction: Automatic memory management with allkeys-lru policy (512MB limit)
- Fallback Mechanism: Continues operation even when cache is unavailable
5. Resilient Architecture
- Graceful Degradation: API continues running even if Elasticsearch/Redis are unavailable
- Mock Data Fallback: Agents fall back to curated mock data ensuring users always receive cited answers
- Automatic Recovery: Services reconnect automatically when dependencies return
- Health Checks: All services include health checks with retries for reliability
6. Production-Ready Deployment (Google Compute Engine)
- Resource Optimization: Memory and CPU limits per container (ES: 2.5GB, API: 1.5GB, Frontend: 512MB)
- HTTPS/WSS: Nginx reverse proxy with Let's Encrypt SSL for secure REST and WebSocket connections
- Container Orchestration: Docker Compose with automatic restart policies and dependency management
- Monitoring Stack: Elasticsearch + Kibana + APM Server for comprehensive observability
Backend:
- Python 3.11+ with FastAPI
- LangGraph 0.2.x & LangChain 0.3.x for multi-agent orchestration
- Elasticsearch 8.x for hybrid search (BM25 + vector)
- Google Vertex AI (gemini-embedding-001 for embeddings; gemini-2.5-flash/pro for synthesis)
- Redis for embedding caching and search result caching
- SQLite for agent state persistence
- Elastic APM for application performance monitoring (optional)
Frontend:
- Next.js 15 (App Router) with TypeScript
- Tailwind CSS + shadcn/ui components
- TanStack Query for state management
- WebSocket for real-time streaming
Infrastructure:
- Google Compute Engine e2-standard-2 VM (8GB RAM, 2 vCPU)
- Docker Compose for container orchestration
- Nginx reverse proxy with HTTPS (Let's Encrypt SSL)
- GitHub Actions for CI/CD
- Certbot for automated SSL certificate management
βββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β Next.js ββββββΆβ FastAPI ββββββΆβ Elasticsearch β
β Frontend β β Backend β β Hybrid Search β
βββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β
ββββββββββββββββΆ Vertex AI (Gemini)
β
ββββββββββββββββΆ Redis Cache
β
ββββββββββββββββΆ SQLite (State)
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Event: AI Accelerate: Unlocking New Frontiers Challenge: Elastic Challenge Submission Date: October 2025 Developer: Mohan Krishna Alavala
β Google Cloud Integration - Uses Vertex AI for embeddings (text-embedding-004) and LLM (Gemini 2.5 Flash) β Elastic Integration - Elasticsearch 8.15 for hybrid search (vector + BM25) β Open Source - Apache 2.0 License, public repository β Original Work - Built from scratch during hackathon period β Functional Demo - Deployed and accessible with video demonstration β Documentation - Comprehensive README, setup instructions, and code comments
- AI Accelerate Hackathon - For providing the platform and challenge
- Google Cloud - Vertex AI platform and Gemini models
- Elastic - Elasticsearch hybrid search capabilities
- shadcn/ui - Beautiful, accessible UI components
- PubMed, ClinicalTrials.gov, FDA - Public medical data sources
- Open Source Community - For the amazing tools and libraries
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
This project uses the following open-source libraries and services:
Backend:
- FastAPI - MIT License
- LangChain - MIT License
- LangGraph - MIT License
- Elasticsearch Python Client - Apache 2.0 License
- Pydantic - MIT License
Frontend:
- Next.js - MIT License
- React - MIT License
- Tailwind CSS - MIT License
- shadcn/ui - MIT License
- Radix UI - MIT License
- Lucide Icons - ISC License
Cloud Services:
- Google Cloud Vertex AI - Commercial service
- Elasticsearch - Elastic License 2.0 / SSPL
Data Sources:
- PubMed - Public domain (U.S. Government)
- ClinicalTrials.gov - Public domain (U.S. Government)
- FDA Drugs Database - Public domain (U.S. Government)
Mohan Krishna Alavala π§ Email: mohanalavala68@gmail.com π GitHub: @mohankrishnaalavala πΌ LinkedIn: Mohan Krishna Alavala
Made with β€οΈ for healthcare professionals
Empowering medical research through AI








