--- title: Clinical Decision Support Agent emoji: ๐Ÿ“ˆ colorFrom: green colorTo: blue sdk: gradio app_file: app.py pinned: false license: mit pipeline_tag: text-generation base_model: mistralai/Mistral-7B-v0.1 tags: - medical-ai - llm - clinical-decision-support - langgraph - pubmed - groq - llama - agent - medical - rag - nlp - healthcare - gradio - langchain --- # ๐Ÿฅ Clinical Decision Support Agent ![Python](https://img.shields.io/badge/Python-3.10-blue) ![LLaMA](https://img.shields.io/badge/LLaMA-3.3%2070B-green) ![LangGraph](https://img.shields.io/badge/LangGraph-Agent-purple) ![HuggingFace](https://img.shields.io/badge/HuggingFace-Spaces-yellow) ## ๐ŸŽฏ Live Demo ๐Ÿ‘‰ [Try it on Hugging Face Spaces](https://huggingface.co/spaces/mou11/clinical-decision-support-agent) ## ๐Ÿ” Overview A production-grade Medical AI Agent that takes patient symptoms as natural language input, searches real PubMed medical literature automatically, and generates structured clinical recommendations with citations. Built with LangGraph for agent orchestration and Groq (LLaMA 3.3 70B) for clinical reasoning. ## ๐Ÿ“Š Results | Metric | Score | |--------|-------| | BERTScore Precision | 0.8449 | | BERTScore Recall | 0.8887 | | BERTScore F1 | 0.8663 | ## ๐Ÿงช Test Cases | Case | Symptoms | Urgency Level | |------|----------|--------------| | Case 1 | Fever, cough, chest pain | High โœ… | | Case 2 | Stiff neck, fever, confusion | Emergency โœ… | | Case 3 | Chest pain radiating to left arm, diabetes | Emergency โœ… | ## โœจ Features - โœ… Real-time PubMed literature search via NCBI API - โœ… LLM-powered clinical reasoning (LLaMA 3.3 70B via Groq) - โœ… Structured output: conditions, tests, treatments, urgency - โœ… Multi-turn conversation memory - โœ… BERTScore quality evaluation - โœ… Interactive Gradio web interface ## ๐Ÿ—๏ธ Architecture Patient Symptoms โ†’ Extract Search Query (LLM) โ†’ Search PubMed (NCBI API) โ†’ Generate Recommendation (LLaMA 3.3 70B) โ†’ Format Report โ†’ Gradio UI ## ๐Ÿ› ๏ธ Tech Stack | Component | Tool | |-----------|------| | Agent Orchestration | LangGraph | | LLM | Groq โ€” LLaMA 3.3 70B | | Medical Literature | PubMed NCBI API | | Evaluation | BERTScore | | UI | Gradio | | Platform | Kaggle T4 GPU | ## ๐Ÿš€ How to Run 1. Get a free Groq API key at [console.groq.com](https://console.groq.com) 2. Clone the Space and install requirements 3. Set your Groq API key as environment variable 4. Run `python app.py` ## โš ๏ธ Medical Disclaimer This system is for educational and research purposes only. It does not provide medical advice. Always consult a qualified healthcare professional for medical decisions. ## ๐Ÿ“Œ Part of Medical AI Portfolio 1. โœ… Pneumonia Detection (ViT + Grad-CAM) 2. โœ… Clinical Decision Support Agent (LangGraph + RAG) โ€” this project 3. โœ… Medical LLM Fine-tuning (QLoRA) 4. โœ… Medical Report Generator (Hallucination Detection + FHIR)