# Multi-Agent-Medical-Assistant **Repository Path**: wangyao0512/Multi-Agent-Medical-Assistant ## Basic Information - **Project Name**: Multi-Agent-Medical-Assistant - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-07 - **Last Updated**: 2026-04-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
! :)
π **For an even more detailed demo video**: Check out [`Multi-Agent-Medical-Assistant-v1.9`](assets/Multi-Agent-Medical-Assistant-v1.9_Compressed.mp4). π½οΈ
---
## π‘οΈ Technical Flow Chart

---
## β¨ Key Features
- π€ **Multi-Agent Architecture** : Specialized agents working in harmony to handle diagnosis, information retrieval, reasoning, and more
- π **Advanced Agentic RAG Retrieval System** :
- Docling based parsing to extract text, tables, and images from PDFs.
- Embedding markdown formatted text, tables and LLM based image summaries.
- LLM based semantic chunking with structural boundary awareness.
- LLM based query expansion with related medical domain terms.
- Qdrant hybrid search combining BM25 sparse keyword search along with dense embedding vector search.
- HuggingFace Cross-Encoder based reranking of retrieved document chunks for accurate LLM reponses.
- Input-output guardrails to ensure safe and relevant responses.
- Links to source documents and images present in reference document chunks provided with reponse.
- Confidence-based agent-to-agent handoff between RAG and Web Search to prevent hallucinations.
- π₯ **Medical Imaging Analysis**
- Brain Tumor Detection (TBD)
- Chest X-ray Disease Classification
- Skin Lesion Segmentation
- π **Real-time Research Integration** : Web search agent that retrieves the latest medical research papers and findings
- π **Confidence-Based Verification** : Log probability analysis ensures high accuracy in medical recommendations
- ποΈ **Voice Interaction Capabilities** : Seamless speech-to-text and text-to-speech powered by Eleven Labs API
- π©ββοΈ **Expert Oversight System** : Human-in-the-loop verification by medical professionals before finalizing outputs
- βοΈ **Input & Output Guardrails** : Ensures safe, unbiased, and reliable medical responses while filtering out harmful or misleading content
- π» **Intuitive User Interface** : Designed for healthcare professionals with minimal technical expertise
> [!NOTE]
> Upcoming features:
> 1. Brain Tumor Medical Computer Vision model integration.
> 2. Open to suggestions and contributions.
---
## π οΈ Technology Stack
| Component | Technologies |
|-----------|-------------|
| πΉ **Backend Framework** | FastAPI |
| πΉ **Agent Orchestration** | LangGraph |
| πΉ **Document Parsing** | Docling |
| πΉ **Knowledge Storage** | Qdrant Vector Database |
| πΉ **Medical Imaging** | Computer Vision Models |
| | β’ Brain Tumor: Object Detection (PyTorch) |
| | β’ Chest X-ray: Image Classification (PyTorch) |
| | β’ Skin Lesion: Semantic Segmentation (PyTorch) |
| πΉ **Guardrails** | LangChain |
| πΉ **Speech Processing** | Eleven Labs API |
| πΉ **Frontend** | HTML, CSS, JavaScript |
| πΉ **Deployment** | Docker, GitHub Actions CI/CD |
---
## π Installation & Setup
## π Option 1: Using Docker
### Prerequisites:
- [Docker](https://docs.docker.com/get-docker/) installed on your system
- API keys for the required services
### 1οΈβ£ Clone the Repository
```bash
git clone https://github.com/souvikmajumder26/Multi-Agent-Medical-Assistant.git
cd Multi-Agent-Medical-Assistant
```
### 2οΈβ£ Create Environment File
- Create a `.env` file in the root directory and add the following API keys:
> [!NOTE]
> You may use any llm and embedding model of your choice...
> 1. If using Azure OpenAI, no modification required.
> 2. If using direct OpenAI, modify the llm and embedding model definitions in the 'config.py' and provide appropriate env variables.
> 3. If using local models, appropriate code changes might be required throughout the codebase especially in 'agents'.
> [!WARNING]
> Ensure the API keys in the `.env` file are correct and have the necessary permissions.
> No trailing whitespaces after variable names.
```bash
# LLM Configuration (Azure Open AI - gpt-4o used in development)
# If using any other LLM API key or local LLM, appropriate code modification is required
deployment_name=
model_name=gpt-4o
azure_endpoint=
openai_api_key=
openai_api_version=
# Embedding Model Configuration (Azure Open AI - text-embedding-ada-002 used in development)
# If using any other embedding model, appropriate code modification is required
embedding_deployment_name=
embedding_model_name=text-embedding-ada-002
embedding_azure_endpoint=
embedding_openai_api_key=
embedding_openai_api_version=
# Speech API Key (Free credits available with new Eleven Labs Account)
ELEVEN_LABS_API_KEY=
# Web Search API Key (Free credits available with new Tavily Account)
TAVILY_API_KEY=
# Hugging Face Token - using reranker model "ms-marco-TinyBERT-L-6"
HUGGINGFACE_TOKEN=
# (OPTIONAL) If using Qdrant server version, local does not require API key
QDRANT_URL=
QDRANT_API_KEY=
```
### 3οΈβ£ Build the Docker Image
```bash
docker build -t medical-assistant .
```
### 4οΈβ£ Run the Docker Container
```bash
docker run -d --name medical-assistant-app -p 8000:8000 --env-file .env medical-assistant
```
The application will be available at: [http://localhost:8000](http://localhost:8000)
### 5οΈβ£ Ingest Data into Vector DB from Docker Container
- To ingest a single document:
```bash
docker exec medical-assistant-app python ingest_rag_data.py --file ./data/raw/brain_tumors_ucni.pdf
```
- To ingest multiple documents from a directory:
```bash
docker exec medical-assistant-app python ingest_rag_data.py --dir ./data/raw
```
### Managing the Container:
#### Stop the Container
```bash
docker stop medical-assistant-app
```
#### Start the Container
```bash
docker start medical-assistant-app
```
#### View Logs
```bash
docker logs medical-assistant-app
```
#### Remove the Container
```bash
docker rm medical-assistant-app
```
### Troubleshooting:
#### Container Health Check
The container includes a health check that monitors the application status. You can check the health status with:
```bash
docker inspect --format='{{.State.Health.Status}}' medical-assistant-app
```
#### Container Not Starting
If the container fails to start, check the logs for errors:
```bash
docker logs medical-assistant-app
```
## π Option 2: Without Using Docker
### 1οΈβ£ Clone the Repository
```bash
git clone https://github.com/souvikmajumder26/Multi-Agent-Medical-Assistant.git
cd Multi-Agent-Medical-Assistant
```
### 2οΈβ£ Create & Activate Virtual Environment
- If using conda:
```bash
conda create --name