How abdulrahman2005-prog/medical_rag works
ClinixAI is a clinical evidence-retrieval assistant over an indexed WHO guideline. Its primary workflow accepts a question in Streamlit, embeds it, retrieves top-ranked passages, applies a similarity threshold, then displays evidence or refuses unsupported questions. A separate FastAPI route also serves questions and can generate cited answers through the LLM integration. The repository includes document-preparation modules, but their end-to-end wiring is not shown in the excerpts; those links are marked unverified. The Streamlit excerpt is partial, so the README supports some workflow relationships.
Main entry points: api.py Question API · streamlit_app.py Top-K Search · embedding.py Chunk Embeddings · faiss.index FAISS Index
Components 16
Question Interfaces
- Clinical Interface
streamlit_app.py - Question API
api.py - Evidence or Refusal
streamlit_app.py
Evidence Retrieval
- Query Embedding
streamlit_app.py - Top-K Search
streamlit_app.py - Grounding Check
streamlit_app.py - FAISS Index
data/faiss.index - Chunk Metadata
data/metadata.json
Knowledge Preparation
- Page Parsing
parsing.py - Text Cleaning
cleaning.py - Evidence Chunking
chunking.py - Chunk Embeddings
embedding.py
Answering Services
- Grounded Answering
llm.py
Other components
- Clinician
- API Client
- Groq Service
Connections 18
- Clinician → Clinical Interface: asks
README.md - Clinical Interface → Query Embedding: embeds question
streamlit_app.py - Query Embedding → Top-K Search: passes vector
streamlit_app.py - Top-K Search → FAISS Index: searches index
streamlit_app.py - Top-K Search → Chunk Metadata: reads passages
README.md - Top-K Search → Grounding Check: ranks evidence
README.md - Grounding Check → Evidence or Refusal: decides PASS or REFUSE
README.md - Clinical Interface → Evidence or Refusal: displays evidence
README.md - API Client → Question API: submits question
- Question API → FAISS Index: searches index
api.py - Question API → Chunk Metadata: reads passages
api.py - Question API → Grounded Answering: requests answer
api.py - Grounded Answering → Groq Service: calls model
llm.py - Page Parsing → Text Cleaning: prepares text
- Text Cleaning → Evidence Chunking: supplies cleaned text
- Evidence Chunking → Chunk Embeddings: supplies chunks
- Chunk Embeddings → FAISS Index: builds vectors
- Chunk Embeddings → Chunk Metadata: stores chunk details