How sk6594246/h_buddy works
Health Buddy is a family health-claim fact-checker with two interfaces: a PWA backed by FastAPI and a Gradio app. A claim is optionally extracted from an uploaded PDF or image, matched against a curated medical corpus, and sent with retrieved evidence to a language model for a verdict and cited explanation. The PWA also keeps local claim history and supports offline asset caching. The README documents a hosted Gradio endpoint and a Pages PWA; the sampled frontend instead posts to /check, so deployment-specific wiring is not inferred.
Main entry points: main.py FastAPI endpoint · rag.py Chunk and retrieve evidence · llm.py Verdict and report · app.js Health Buddy PWA
Components 14
User interfaces
- Health Buddy PWA
frontend/app.js - Offline asset cache
frontend/sw.js - Browser claim history
- Gradio interface
app.py
Claim processing
- FastAPI endpoint
backend/main.py - Daily claim limit
backend/main.py - PDF and image extraction
backend/main.py
Evidence retrieval
- Medical text corpus
backend/corpus - Chunk and retrieve evidence
backend/rag.py - Sentence embeddings
backend/rag.py - FAISS vector index
backend/rag.py
Verdict generation
- Verdict and report
backend/llm.py
Other components
- Family member
- Groq chat API
Connections 16
- Family member → Health Buddy PWA: submits claim
- Health Buddy PWA → FastAPI endpoint: POSTs claim
- Health Buddy PWA → Browser claim history: reads and writes
- Offline asset cache → Family member: serves cached assets
- Family member → Gradio interface: submits claim
- Gradio interface → Chunk and retrieve evidence: retrieves evidence
- Gradio interface → Verdict and report: requests verdict
- FastAPI endpoint → Daily claim limit: checks quota
- FastAPI endpoint → PDF and image extraction: extracts upload text
- FastAPI endpoint → Chunk and retrieve evidence: retrieves evidence
- FastAPI endpoint → Verdict and report: requests verdict
- Chunk and retrieve evidence → Medical text corpus: loads text
- Chunk and retrieve evidence → Sentence embeddings: encodes chunks and query
- Chunk and retrieve evidence → FAISS vector index: builds and searches
- Verdict and report → Groq chat API: requests completion
- Groq chat API → Verdict and report: returns JSON