Spaces:
Running
Running
Readme and app.py
Browse files
README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Medical RAG API
|
| 3 |
+
emoji: 🏥
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Agentic Medical RAG API
|
| 11 |
+
|
| 12 |
+
A medical question-answering system using Retrieval-Augmented Generation (RAG) with agentic capabilities.
|
| 13 |
+
|
| 14 |
+
## Features
|
| 15 |
+
|
| 16 |
+
- Medical document retrieval using FAISS vector store
|
| 17 |
+
- Question answering with context-aware responses
|
| 18 |
+
- RESTful API built with FastAPI
|
| 19 |
+
- Docker containerized deployment
|
| 20 |
+
|
| 21 |
+
## API Endpoints
|
| 22 |
+
|
| 23 |
+
- `GET /`: Health check
|
| 24 |
+
- `POST /ask`: Submit medical questions and get AI-powered answers
|
| 25 |
+
|
| 26 |
+
## Usage
|
| 27 |
+
|
| 28 |
+
Send a POST request to `/ask` with your medical question in the request body.
|
app.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Startup script for Medical RAG AI Advisor API
|
| 3 |
+
"""
|
| 4 |
+
import sys
|
| 5 |
+
import os
|
| 6 |
+
import uvicorn
|
| 7 |
+
|
| 8 |
+
# Add core to Python path
|
| 9 |
+
sys.path.append(os.path.join(os.path.dirname(__file__), 'core'))
|
| 10 |
+
|
| 11 |
+
if __name__ == "__main__":
|
| 12 |
+
|
| 13 |
+
uvicorn.run(
|
| 14 |
+
"api.app:app",
|
| 15 |
+
host="127.0.0.1", # Use localhost instead of 0.0.0.0
|
| 16 |
+
port=8000,
|
| 17 |
+
reload=True, # Disable reload in production for faster startup
|
| 18 |
+
log_level="info",
|
| 19 |
+
access_log=True,
|
| 20 |
+
workers=1 # Single worker for development
|
| 21 |
+
)
|