How chandrugiri/healthcare-guide-ai works
Healthcare Guide AI is a source-grounded conversational healthcare information app. A user submits a question through the Next.js chat; FastAPI routes it to RAG orchestration, which handles greetings and medication-safety requests deterministically or retrieves evidence, generates a grounded answer, and returns backend-controlled citations. The repository also includes a corpus-ingestion path from PDF parsing through chunking, embedding, and vector storage. The README documents these capabilities; edges for unsampled frontend and ingestion internals rely on its descriptions or SOURCE INDEX references.
Main entry points: ingest_corpus.py Corpus ingestion · chat.py Chat endpoint · rag_service.py RAG orchestration · retrieval_service.py Semantic retrieval
Components 22
Chat interface
- Chat interface
frontend/src/components/chat/chat-shell.tsx - Message input
frontend/src/components/chat/message-input.tsx - Chat API client
frontend/src/lib/chat-api.ts - Message and citations
frontend/src/components/chat/chat-message.tsx - Source citations
frontend/src/components/chat/source-citations.tsx
API and orchestration
- FastAPI app
backend/app/main.py - Chat endpoint
backend/app/api/routes/chat.py - Chat contracts
backend/app/models/chat.py - Health endpoint
backend/app/api/routes/health.py
Retrieval and answers
- RAG orchestration
backend/app/services/rag_service.py - Semantic retrieval
backend/app/services/retrieval_service.py - Embedding service
backend/app/services/embedding_service.py - Answer generation
backend/app/services/generation_service.py - Retrieved chunks
backend/app/models/retrieval.py
Corpus preparation
- Corpus ingestion
backend/app/scripts/ingest_corpus.py - PDF parsing
backend/app/services/pdf_parser.py - Text chunking
backend/app/services/text_chunker.py - Document records
backend/app/models/document.py
Vector storage
- Vector store adapter
backend/app/services/vector_store.py - Chroma database
Other components
- User
- Gemini services
Connections 25
- User → Chat interface: asks
README.md - Chat interface → Message input: renders
frontend/src/components/chat/chat-shell.tsx - Message input → Chat API client: submits
- Chat API client → FastAPI app: POSTs chat
README.md - FastAPI app → Chat endpoint: routes chat
backend/app/main.py - Chat endpoint → RAG orchestration: invokes
backend/app/api/routes/chat.py - Chat endpoint → Chat contracts: validates response
backend/app/api/routes/chat.py - RAG orchestration → Semantic retrieval: retrieves evidence
backend/app/services/rag_service.py - RAG orchestration → Answer generation: generates answer
backend/app/services/rag_service.py - Semantic retrieval → Embedding service: embeds query
backend/app/services/retrieval_service.py - Semantic retrieval → Vector store adapter: searches vectors
backend/app/services/retrieval_service.py - Semantic retrieval → Retrieved chunks: returns chunks
backend/app/services/retrieval_service.py - Embedding service → Gemini services: requests embeddings
backend/app/services/embedding_service.py - Answer generation → Gemini services: requests generation
backend/app/services/generation_service.py - Corpus ingestion → PDF parsing: parses PDFs
backend/app/scripts/ingest_corpus.py - Corpus ingestion → Text chunking: chunks pages
backend/app/scripts/ingest_corpus.py - Corpus ingestion → Embedding service: embeds chunks
backend/app/scripts/ingest_corpus.py - Corpus ingestion → Vector store adapter: stores vectors
backend/app/scripts/ingest_corpus.py - PDF parsing → Document records: produces pages
backend/app/services/pdf_parser.py - Text chunking → Document records: produces chunks
backend/app/services/text_chunker.py - Vector store adapter → Chroma database: reads and writes
README.md - RAG orchestration → Chat contracts: returns citations
backend/app/services/rag_service.py - Chat interface → Message and citations: renders messages
frontend/src/components/chat/chat-shell.tsx - Message and citations → Source citations: renders sources
frontend/src/components/chat/chat-message.tsx - Chat endpoint → Health endpoint