AI agent that maps medical deserts across Ghana — extracting, verifying, and reasoning over 987 healthcare facilities to connect patients with care.
# Medical Intelligence Agent
Bridging Medical Deserts | Databricks Track
An Intelligent Document Parsing (IDP) agent that extracts, verifies, and reasons over medical facility data from Ghana to identify medical deserts and infrastructure gaps.
---
## Architecture
```
User Question
|
v
Streamlit UI ──> LangGraph Agent Graph ──> Databricks Free Edition
(local) (local orchestration) (remote services)
```
**LangGraph** orchestrates a multi-agent graph. Each agent node calls **Databricks** services (Genie, Vector Search, Model Serving). **MLflow** traces every step. **Streamlit** renders the frontend.
### Agent Nodes
| Node | Purpose | Databricks Service |
|------|---------|--------------------|
| **Supervisor** | Classifies intent, routes to correct agent | Model Serving (LLM) |
| **SQL Agent** | Structured queries (counts, aggregations) | Genie (Text-to-SQL) |
| **RAG Agent** | Semantic search over facility descriptions | Vector Search |
| **IDP Extraction** | Extracts structured facts from free-form text | Model Serving (LLM) |
| **Medical Reasoning** | Anomaly detection, plausibility checks | Model Serving (LLM) |
| **Geospatial** | Distance queries, medical desert detection | Local (Haversine) + SQL |
| **Synthesis** | Merges results into cited Markdown answer | Model Serving (LLM) |
---
## Prerequisites
- **Python 3.13+** (managed via `pyenv` — see `.python-version`)
- **Databricks Free Edition** account with:
- A SQL Warehouse (auto-provisioned on Free Edition)
- A Personal Access Token (PAT)
- **Git**
---
## Quick Start
### 1. Clone and set up Python environment
```bash
git clone
github.com
# If using pyenv (recommended)
pyenv install 3.13.4
pyenv local 3.13.4
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # macOS/Linux
# .venv\Scripts\activate # Windows
pip install -r requirements.txt
```
### 2. Configure environment variables
```bash
cp .env …