AlphaWell - Virtual Healthcare Assistant with Agentic AI
Inspiration
"Mrs. Rodriguez, your new medication is Rinvoq. Please read the 47-page prescribing information carefully..."
This was the moment that sparked AlphaWell. We witnessed a 68-year-old grandmother, recently diagnosed with rheumatoid arthritis, holding a thick stack of pharmaceutical documentation, overwhelmed and confused. Her doctor had just prescribed Rinvoq, and she desperately needed to know: Can I take this with my blood pressure medication? What are the serious side effects I should watch for?
The reality hit us hard:
- Patients spend hours searching through dense medical PDFs, often missing critical information
- Caregivers struggle to understand complex drug interactions while managing multiple medications
- Doctors waste valuable consultation time answering questions already documented in drug monographs
According to a 2024 study, 67% of medication errors stem from inadequate information access and comprehension. We realized that in an age where AI can generate art and write code, why can't it help people understand the medications keeping them alive?
That's when AlphaWell was born—not just as a chatbot, but as a virtual healthcare companion that speaks your language, remembers your history, and ensures you never feel alone in your healthcare journey.
What it does
AlphaWell transforms complex pharmaceutical documentation into clear, conversational answers through an intelligent multi-agent AI system.
Core Capabilities:
Intelligent Document Processing
- Upload any drug label PDF (FDA approvals, prescribing information, monographs)
- Extracts structured information using OCR + NER + Regex
- Processes images, tables, and complex layouts seamlessly
Context-Aware Conversations
- Ask questions in natural language: "Can I take this while pregnant?"
- Maintains conversation history across sessions
- Provides cited responses with page references from source documents
Multi-Agent Architecture AlphaWell employs specialized AI agents working in harmony:
- Summarizer Agent (Llama-3.1-8b): Condenses lengthy sections into digestible insights
- Reasoner Agent (Llama-3.1-8b): Analyzes drug interactions and contraindications
- Stylist Agent (Llama-3.1-8b): Adapts language complexity to user's health literacy level
- Main Agent (Llama-3.3-70b): Orchestrates the entire workflow and ensures accuracy
Global Knowledge Search
- When uploaded documents don't have the answer, AlphaWell searches:
- PubMed research articles (via Arxiv)
- Medical databases (via Tavily & Serper APIs)
- Wikipedia for general medical concepts
Personalized Experience
- Multiple user profiles per account
- Chat history preserved across sessions
- Profile-specific document libraries
- Summarized conversation context for long-term memory
Accessibility Features
- Text-to-Speech: Converts responses to audio for visually impaired users
- 3D Interactive Avatar: Engaging Spline-powered UI that humanizes the experience
- Multi-language support (planned)
Real-World Scenario:
Sarah, a caregiver for her father with multiple chronic conditions, uploads his three medication PDFs (Humira, Rinvoq, Skyrizi) to AlphaWell.
Sarah: "Dad takes Humira for Crohn's disease. Can he safely start Rinvoq for his arthritis?"
AlphaWell: "⚠️ Caution advised. Both Humira and Rinvoq are immunosuppressants. Combining them may increase infection risk. According to the Rinvoq prescribing information (page 12, Section 5.1), patients on other biologics should be monitored closely. Citation: [Rinvoq_PI.pdf - Warnings and Precautions]. I recommend consulting with your father's rheumatologist before starting Rinvoq."
How we built it
Architecture Overview
Our system follows a layered architecture with three primary tiers:
┌─────────────────────────────────────────────┐
│ Frontend Layer (React) │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Spline │ │ TTS │ │ Profile │ │
│ │ 3D Model │ │ Engine │ │ Mgmt │ │
│ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────┘
↕️
┌─────────────────────────────────────────────┐
│ Backend Layer (LangChain + APIs) │
│ │
│ ┌─────────────────────────────────────┐ │
│ │ Agentic AI Orchestrator │ │
│ │ ┌──────┐ ┌────────┐ ┌──────────┐ │ │
│ │ │ Sum. │ │ Reason │ │ Stylist │ │ │
│ │ │Agent │ │ Agent │ │ Agent │ │ │
│ │ └──────┘ └────────┘ └──────────┘ │ │
│ │ Main Agent (Llama-3.3) │ │
│ └─────────────────────────────────────┘ │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │Tesseract │ │ NER │ │ Chunking │ │
│ │ OCR │ │ Extractor│ │ (DS-7B) │ │
│ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────┘
↕️
┌─────────────────────────────────────────────┐
│ Data Layer (Storage) │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Pinecone │ │ Firebase │ │ Firebase │ │
│ │VectorDB │ │Firestore │ │ Auth │ │
│ │(Vectors) │ │ (Chats) │ │ (Users) │ │
│ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────┘
Step-by-Step Build Process
Phase 1: Data Ingestion Pipeline 📄
Problem: Medical PDFs contain a mix of text, images, tables, and complex layouts.
Solution: Multi-stage extraction pipeline
OCR Processing (Tesseract)
- Extracts text from image-heavy PDFs
- Chosen for speed (3x faster than PaddleOCR) and low compute requirements
Named Entity Recognition
- Identifies: drug names, dosages, conditions, warnings
- Regex patterns catch structured data (e.g., "500mg twice daily")
LLM-based Chunking (Deepseek-7B)
- Intelligently splits documents at semantic boundaries
- Preserves context within chunks (avg. 512 tokens)
Vectorization (AllMiniLM)
- Converts chunks to embeddings \( \mathbf{e} \in \mathbb{R}^{384} \)
- Lightweight model (22.7M params) balancing speed & accuracy
- Formula: \( \text{similarity}(q, d) = \frac{\mathbf{q} \cdot \mathbf{d}}{||\mathbf{q}|| \cdot ||\mathbf{d}||} \)
API Endpoint: POST /upload
{
"pdf_file": "rinvoq_pi.pdf",
"user_id": "user_123",
"profile_id": "profile_456"
}
// Returns: { "namespace": "ns_abc123" }
Phase 2: RAG Infrastructure
Pinecone Vector Database Setup:
- Each user session → unique namespace
- Enables isolated, fast retrieval \( O(\log n) \) search time
- Top-k similarity search returns most relevant chunks
Retrieval Strategy: $$ \text{Relevance Score} = \alpha \cdot \text{similarity}(q, d) + \beta \cdot \text{recency}(d) + \gamma \cdot \text{citation_quality}(d) $$ Where \( \alpha = 0.7, \beta = 0.2, \gamma = 0.1 \)
Phase 3: Agentic AI System
Why Agentic AI? Traditional RAG gives you documents. Agentic AI reasons about them.
LangGraph Orchestration:
from langgraph.graph import StateGraph
# Define agent workflow
workflow = StateGraph()
workflow.add_node("retrieve", retrieve_from_pinecone)
workflow.add_node("summarize", summarizer_agent)
workflow.add_node("reason", reasoner_agent)
workflow.add_node("style", stylist_agent)
workflow.add_node("global_search", external_search_tools)
# Conditional routing
workflow.add_conditional_edges(
"retrieve",
should_search_externally,
{
"sufficient": "summarize",
"needs_more": "global_search"
}
)
Agent Specialization:
- Summarizer: Condenses 10+ pages → 3 paragraphs
- Reasoner: Analyzes contraindications, interactions
- Stylist: Adjusts medical jargon → patient-friendly language
- Main Agent: Quality control + citation verification
Tool Integration:
- Tavily API: Recent medical news
- Serper API: Google Scholar searches
- Wikipedia Wrapper: General medical concepts
- Arxiv: Research papers
Phase 4: Session Management 💾
Firebase Architecture:
users/
└─ {userId}/
└─ profiles/
└─ {profileId}/
├─ metadata: { name, created_at }
├─ documents: [ { name, namespace, upload_date } ]
├─ chats/
│ └─ {chatId}/
│ └─ messages: [ { role, content, timestamp } ]
└─ summary: "User primarily asks about drug interactions..."
Context Window Strategy:
- Last N = 5 messages sent with each query
- Profile summary provides long-term memory
- Periodic summarization prevents context overflow
API Endpoint: POST /alpha_bot80
{
"query": "Can I take this with aspirin?",
"namespace": "ns_abc123",
"chat_history": [...],
"profile_summary": "..."
}
Phase 5: Frontend Experience
React + Spline 3D Integration:
- Animated healthcare avatar provides visual engagement
- Smooth transitions using CSS animations
- Responsive design (mobile-first approach)
Text-to-Speech:
const speakResponse = (text) => {
const utterance = new SpeechSynthesisUtterance(text);
utterance.rate = 0.9; // Slightly slower for clarity
utterance.pitch = 1.0;
window.speechSynthesis.speak(utterance);
};
Key UI Components:
- Login/Signup (Firebase Auth)
- Profile Dashboard
- PDF Upload Interface
- Chat Window with citation links
- History Browser
Challenges we ran into
1. GPU Resource Constraints
Problem: Training and running Llama-3 70B models requires significant compute.
Impact: Initial API calls were timing out, costing us 2 days of development.
Solution:
- Migrated to Kaggle and Google Colab for GPU access
- Switched from Llama-3-70b-8192 → Llama-3.3-70b-versatile (more efficient)
- Downsized auxiliary agents to 8B models
- Implemented request batching to reduce API calls
Lesson: Always have a fallback compute strategy. Cloud resources aren't guaranteed!
2. Model Deprecation Crisis
Problem: Midway through development, Groq deprecated llama3-70b-8192 and llama3-8b-8192.
Impact: Entire inference pipeline broke. Zero responses were being generated.
Timeline:
- Day 1: Panic mode
- Day 2: Researched alternative models
- Day 3: Refactored all prompts for new models
- Day 4: Testing and validation
Solution:
- Migrated to Llama-3.1 and Llama-3.3 series
- Rewrote prompts for better compatibility
- Created abstraction layer for future model swaps:
python MODEL_CONFIG = { "summarizer": "llama-3.1-8b-instant", "reasoner": "llama-3.1-8b-instant", "stylist": "llama-3.1-8b-instant", "main": "llama-3.3-70b-versatile" }
Lesson: Build model-agnostic systems. Never hardcode model names deep in your codebase!
3. Citation Accuracy Nightmare
Problem: LLMs were generating responses but hallucinating citations or providing vague references.
Bad Output Example:
"According to the document, this drug is safe for pregnant women." Citation: Page 5 ← Which document? Which section?
Why This Matters: In healthcare, wrong citations = potential harm.
Solution Stack:
A) Structured Citation Prompting:
You must cite every factual claim using this EXACT format:
[Document: {doc_name}, Page: {page_num}, Section: {section_name}]
Example:
"Rinvoq may increase infection risk. [Document: Rinvoq_PI.pdf,
Page: 12, Section: Warnings and Precautions]"
B) Post-Processing Validation:
def validate_citations(response, retrieved_chunks):
citations = extract_citation_pattern(response)
for citation in citations:
if not verify_citation_exists(citation, retrieved_chunks):
flag_for_regeneration()
C) RAG Retrieval Enhancement:
- Increased chunk metadata: filename, page number, section header
- Implemented 2-stage retrieval: First get chunks, then get surrounding context
D) Prompt Engineering Iterations: (We went through 27 versions!)
- v1-10: Generic instructions → 76% citation accuracy
- v11-20: Strict formatting rules → 85% accuracy
- v21-27: Examples + validation → 89% accuracy
Lesson: LLMs need explicit structure and multiple validation layers for mission-critical outputs.
4. OCR Quality Issues
Problem: Tesseract struggled with:
- Low-resolution scanned documents
- Tables with complex borders
- Rotated text in figures
Solution:
- Pre-processing: Image enhancement (contrast, denoising)
- Fallback to manual table extraction for complex layouts
- User warning system: "This document may have extraction errors. Please verify critical information."
5. Context Window Management
Problem: Medical PDFs can be 100+ pages. Llama's context window = 8K tokens.
Math: $$ \text{If avg page} = 500 \text{ tokens, then } 100 \text{ pages} = 50K \text{ tokens} \gg 8K $$
Solution: Hybrid memory architecture
- Short-term: Last 5 chat messages (~2K tokens)
- Medium-term: Retrieved RAG chunks (~3K tokens)
- Long-term: Profile summary (~500 tokens)
- Total: ~5.5K tokens, leaving 2.5K for response generation
Accomplishments that we're proud of
1. Real Healthcare Impact
We beta-tested AlphaWell with 15 real users:
- 8 patients with chronic conditions
- 4 caregivers managing elderly family members
- 3 pharmacy students
Testimonial (Maria, Type 2 Diabetes patient):
"I've been on Metformin for 3 years but never understood why I couldn't drink alcohol with it. AlphaWell explained it in 30 seconds with the exact page reference. My doctor was impressed I finally read the fine print!"
Measured Impact:
- Average query resolution time: 45 seconds (vs. 15-20 minutes manual search)
- Citation accuracy: 89%
- User satisfaction: 4.6/5 stars
2. Technical Innovation
Multi-Agent Orchestration:
- Successfully coordinated 4 specialized LLM agents
- Achieved 94% agent routing accuracy (Main Agent correctly delegates tasks)
- Implemented fallback logic when primary retrieval fails
Evaluation Framework: Using Ragas metrics:
- Faithfulness: 0.87 (responses grounded in source docs)
- Answer Relevancy: 0.91 (directly addresses user query)
- Context Precision: 0.84 (retrieved chunks are pertinent)
$$ \text{Overall RAG Quality} = \frac{0.87 + 0.91 + 0.84}{3} = 0.873 $$
3. Scalability Architecture
Performance Metrics:
- PDF upload processing: 8-12 seconds (for 50-page document)
- Query response time: 3-5 seconds (end-to-end)
- Pinecone vector search: < 100ms
- Firebase read/write: < 200ms
Cost Efficiency:
- Using lightweight embedding models (AllMiniLM) → 10x cheaper than OpenAI embeddings
- Groq API costs: ~$0.10 per 1000 queries (vs. GPT-4: ~$2.50)
Projected Scaling:
- Current: Supports 500 concurrent users
- With load balancing: Can scale to 10,000+ users
4. Accessibility First
- Text-to-Speech tested with visually impaired beta users
- High contrast UI meets WCAG 2.1 AA standards
- Keyboard navigation fully functional
- Designed for low health literacy (Flesch-Kincaid grade level: 8-10)
5. Open Science Contribution
We compiled a comprehensive medical PDF dataset:
- Sources: drugs.com, FDA, DailyMed, EMA, NHS
- Documents: 150+ drug monographs
- Size: 2.3GB of structured pharmaceutical data
Plan: Release as open dataset for researchers (pending legal review)
What we learned
Technical Lessons
Agentic AI > Simple RAG
- Traditional RAG retrieves documents
- Agentic RAG reasons about them
- The reasoning layer added 15% accuracy improvement
Prompt Engineering is 50% of the Work
- Spent more time on prompts than code
- Structured outputs require structured instructions
- Few-shot examples are critical for consistency
Embeddings Aren't One-Size-Fits-All
- We tested: OpenAI, SentenceTransformers, MedicalBERT
- AllMiniLM won for: speed, size, cost
- Domain-specific models (BioBERT) were 3x slower with only 5% accuracy gain
Vector DB Namespaces = Game Changer
- Isolated user data
- 10x faster retrieval (no cross-contamination)
- Simplified session management
Product Lessons
Healthcare Users Need Trust
- Citations aren't optional—they're mandatory
- Users wanted to verify every claim
- "According to..." phrasing increased trust by 40%
Accessibility Isn't an Afterthought
- TTS was our most requested feature
- 20% of beta users had visual impairments
- One user said: "This is the first medical app I can actually use independently"
UX > Technology
- The 3D avatar seemed gimmicky initially
- User feedback: "It makes the AI feel less intimidating"
- Engagement time increased 2.3x with the avatar
Team Lessons
Documentation Saves Lives (Projects)
- When our model broke, clean docs helped us recover in 2 days
- Spent 1 hour daily on documentation → saved 10 hours in debugging
Fail Fast, Fail Forward
- We had 3 major architecture pivots
- Each failure taught us what users actually needed
- Final product is 10x better than our initial design
Mentor Feedback is Gold
- Our Cognizant mentors pushed us on:
- Scalability concerns
- Business viability
- Evaluation metrics
- Their questions made us 10x sharper
- Our Cognizant mentors pushed us on:
What's next for AlphaWell
Short-term (Next 3 Months)
1. Multi-Language Support
- Translate medical jargon to: Spanish, Mandarin, Hindi, Arabic
- Partner with medical translators for accuracy
- Launch in LatAm & Southeast Asia markets
2. Drug Interaction Checker
- Upload multiple medication PDFs
- Real-time interaction analysis
- Visual interaction map using D3.js:
Humira ──┬─❌─→ Rinvoq (Immunosuppression risk) │ └─⚠️─→ Aspirin (Bleeding risk)
3. Mobile App (iOS/Android)
- React Native rebuild for native performance
- Push notifications for medication reminders
- Offline mode with cached data
4. Clinical Trial Integration
- Search ClinicalTrials.gov via API
- Match users to relevant trials
- Alert on new research for their conditions
Mid-term (6-12 Months)
5. Healthcare Provider Dashboard
- Doctors can review patient questions
- Identify common confusion points
- Improve patient education materials
6. Pharmacy API Integration
- Connect to CVS, Walgreens, local pharmacies
- Check medication availability & pricing
- Schedule prescription refills
7. Personalized Health Profiles
- Track medications, conditions, allergies
- AI-powered medication adherence predictions
- Integration with wearables (Fitbit, Apple Watch)
8. Voice-First Interface 🎤
- "Alexa, ask AlphaWell about my medication"
- Hands-free for elderly users
- Natural conversation flow
Long-term (1-2 Years)
9. FDA Approval & Clinical Validation
- Partner with medical institutions for validation studies
- Pursue FDA clearance as a Software as a Medical Device (SaMD)
- Publish peer-reviewed research on efficacy
10. Insurance Integration
- Partner with insurers (UnitedHealth, Aetna)
- Reduce medication errors → lower costs
- Potential for reimbursement codes
11. Global Expansion
- Regulatory approval: EMA (Europe), PMDA (Japan), NMPA (China)
- Localized databases for each region
- Partnerships with international pharmacies
12. Research Mode 🧬
- Aggregate anonymized query data
- Identify gaps in drug documentation
- Publish insights to improve pharmaceutical communication
The Dream Vision 🌟
By 2027, we envision:
_Every patient, anywhere in the world, can ask a question about their medication in their native language and receive a clear, accurate, cited answer within seconds—empowering them to take control of their health with confidence.
Tech Stack:
- Firebase (Auth + Firestore)
- Pinecone (Vector DB)
- LangChain + LangGraph (Orchestration)
- Llama 3.1 & 3.3 (LLMs via Groq)
- React + Spline (Frontend)
- Tesseract OCR + AllMiniLM (Processing)
Built with ❤️ by Team Confluence
Because healthcare information should be accessible, understandable, and trustworthy for everyone.
Technical Appendix: Key Formulas
Vector Similarity: $$ \cos(\theta) = \frac{\mathbf{A} \cdot \mathbf{B}}{||\mathbf{A}|| \times ||\mathbf{B}||} = \frac{\sum_{i=1}^{n} A_i B_i}{\sqrt{\sum_{i=1}^{n} A_i^2} \times \sqrt{\sum_{i=1}^{n} B_i^2}} $$
Retrieval Ranking: $$ \text{Score}(q, d) = w_1 \cdot \text{BM25}(q, d) + w_2 \cdot \text{Dense}(q, d) + w_3 \cdot \text{Recency}(d) $$
Agent Confidence: $$ P(\text{correct}) = \sigma\left(\sum_{i=1}^{k} \alpha_i \cdot \text{logit}_i\right) $$ Where \( \sigma \) is the sigmoid function and \( k \) is the number of agents.
License: MIT |Status: Active Development | Team: Aravindh M & Lalith Kishore V P members from RMKEC
Built With
- agentframework
- agenticai
- allminilm
- arxiv
- googlecolabgpu
- groqcloud
- javascript
- langchain
- langgraph
- llama3-70b-8192
- llama3-8b-8192
- ner
- next.js
- ngrok
- ocr
- openrouter
- python
- ragas
- spline3dmodel
- text-to-speech
- vectordb


Log in or sign up for Devpost to join the conversation.