This diagram is designed for recruiter/interviewer walkthroughs.
flowchart TD
A[User Input<br/>UI or API] --> B[RiskModel<br/>Logistic Regression]
B --> C[Orchestrator Agent]
C --> D[Explanation Agent<br/>LLM + fallback rules]
C --> E[Recommendation Agent<br/>LLM + safety context]
C --> F[Retrieval Agent<br/>Medical knowledge RAG]
C --> G[Memory Agent<br/>ChromaDB patient memory]
C --> H[Feature Explainer<br/>SHAP attributions]
C --> I[Safety Guard<br/>alerts + escalation + confidence]
F --> J[data/medical_knowledge.jsonl]
G --> K[data/chroma]
C --> L[Audit Logger]
L --> M[logs/decisions.jsonl]
C --> N[Final Response]
N --> O[Streamlit Dashboard]
N --> P[FastAPI /predict + /v1/predict]
- Validate and normalize input (including BMI calculation).
- Predict probability and classify risk.
- Compute SHAP feature impacts.
- Retrieve similar past cases + relevant medical context.
- Generate explanation and recommendation.
- Apply safety assessment (alerts, escalation, confidence).
- Persist memory and write audit trail.
- Return structured response to UI/API client.