Skip to content

usererrorsoftware/healthcare-it-decision-app

Repository files navigation

Healthcare IT Decision-Making (Gradio + crewAI)

Repository for a multi-agent healthcare IT decision-making app.

  • UI: Gradio with a single text input + report output
  • Orchestration: crewAI with 3 specialized agents
  • Search: serper.dev (Google results API) via SerperDevTool
  • Local RAG: simple CSV (company_data.csv) to ground budget/risk context
  • Output: Executive-ready Markdown report rendered in the app

Built as a Cursor project.


📸 Screenshots

App Screenshot App Screenshot App Screenshot App Screenshot App Screenshot App Screenshot


🧰 Tech Stack

  • Python 3.11.9+
  • crewai, crewai-tools (SerperDevTool), gradio, pandas, python-dotenv

🚀 Getting Started

  1. Clone this repo and enter the folder:

    git clone <your-repo-url>.git
    cd healthcare-it-decision-app
  2. Install dependencies:

    pip install -r requirements.txt
  3. Set API keys (use a .env file or environment variables):

    • OPENAI_API_KEY : for LLM access (used by crewAI)
    • SERPER_API_KEY : for serper.dev web search
    • Optional:
      • CREWAI_MODEL (default: gpt-4o-mini)
      • CREW_MAX_TOKENS (default: 2000)
      • LOCAL_DATA_PATH (default: company_data.csv)

    Example .env:

    OPENAI_API_KEY=sk-your-openai-key
    SERPER_API_KEY=your-serper-key
    CREWAI_MODEL=gpt-4o-mini
    CREW_MAX_TOKENS=2000
  4. Run the app:

    python app.py
  5. Open the local Gradio URL printed in the console.


🧪 Try These Example Prompts

  • Evaluate the pros and cons of migrating our EHR to the cloud (AWS vs Azure).
  • Assess the 3-year TCO for building a new patient-facing mobile app.
  • Should we replace our on-prem PACS with a cloud archive?

🧩 Local RAG (CSV) — Customization

  • Edit company_data.csv to reflect your environment (systems, costs, risk).
  • The LocalDataTool searches this file by keyword and returns a compact JSON with the top matches + cost/risk rollups.
  • To wire a real database or a vector store, replace the tool's implementation in app.py:
    • Keep the function signature the same.
    • Use your DB driver / retrieval client inside.
    • Return JSON so agents can reason over it.

🧱 Repository Layout

healthcare-it-decision-app/
├─ app.py                # single-file app with crewAI + Gradio
├─ requirements.txt
├─ company_data.csv      # sample data source used by LocalDataTool
├─ README.md
└─ images/
   └─ mock_screenshot.png

🔧 Configuration Notes

  • No hard-coded secrets. All API keys are read from env or .env (via python-dotenv).
  • Output is Markdown rendered directly in the Gradio UI.
  • crewAI is configured with a sequential process so agents build on each other's outputs.

🧠 Agents Overview

  • ResearchAgent — Market/standards research with serper.dev
  • FinancialAnalystAgent — TCO/ROI using web + CSV
  • RiskAssessorAgent — Implementation/security risks using web + CSV

The final synthesis task compiles all sections into an executive-ready report with headings:

  1. Summary Recommendation
  2. Budget/Cost Analysis
  3. Potential Downtime & Business Impact
  4. Implementation Risks
  5. Technological Fit & Future-Proofing
  6. Sources

🧱 Limitations & Next Steps

  • This repo is a demo. Cost figures are estimates; always validate with vendors.
  • For production, consider:
    • Audit logging & PHI redaction
    • Model/Tool observability (e.g., Langfuse)
    • Persistent vector DB for richer RAG
    • Caching for deterministic demos
    • Fine-grained prompts & evals

📣 Attribution

Developed by Jeremey King in Cursor.


🐳 Docker (optional)

Build and run with Docker:

docker build -t healthcare-it-decision-app .
docker run --rm -p 7860:7860 --env-file .env healthcare-it-decision-app

🛠 Make targets

make install
make run
make docker-build
make docker-run

🔐 Environment file

Start from .env.example:

cp .env.example .env
# fill in keys

🤖 Using Different Models (Gemini, Llama, etc.)

This app uses crewAI’s LiteLLM integration. Set CREWAI_MODEL to a provider-prefixed model string and provide the matching API key env var.

Examples

  • OpenAI (default):
    CREWAI_MODEL=openai/gpt-4o-mini | Key: OPENAI_API_KEY
  • Google Gemini:
    CREWAI_MODEL=gemini/gemini-1.5-pro | Key: GEMINI_API_KEY
  • Meta Llama via Groq:
    CREWAI_MODEL=groq/llama-3.1-70b-versatile | Key: GROQ_API_KEY
  • Meta Llama via Together:
    CREWAI_MODEL=together_ai/meta-llama/Llama-3-70b-instruct | Key: TOGETHER_API_KEY
  • Meta Llama via OpenRouter:
    CREWAI_MODEL=openrouter/meta-llama/llama-3.1-70b-instruct | Key: OPENROUTER_API_KEY

Tip: If your runs fail with “LLM Provider NOT provided,” you’re likely missing the provider prefix (e.g., openai/, gemini/, groq/, together_ai/, openrouter/).
Use Python 3.11+ for best compatibility.

Minimal .env example for Gemini:

GEMINI_API_KEY=your-gemini-key
CREWAI_MODEL=gemini/gemini-1.5-pro
SERPER_API_KEY=your-serper-key

Minimal .env example for Groq + Llama:

GROQ_API_KEY=your-groq-key
CREWAI_MODEL=groq/llama-3.1-70b-versatile
SERPER_API_KEY=your-serper-key

🔎 serper.dev account (web search)

This app uses serper.dev for real-time web search. Create a free account at serper.dev and generate an API key, then set:

SERPER_API_KEY=your-serper-key

As of now, the first 2,500 queries are free (no credit card required). Check their site for current limits and pricing.