Skip to content

aidevforge/health-agent

Repository files navigation

Healthcare Administration Agents System

An AI-powered multi-agent system for automating medical coding, patient intake triage, and insurance pre-authorization.

Features

  • Voice Input Module: Accept audio input and transcribe using Google Speech-to-Text
  • Patient Intake Agent: Extract patient details from transcribed text
  • Registration Classification: Automatically classify visit types (new/returning/emergency)
  • Medical Coding Agent: Auto-assign CPT and ICD-10 codes using RAG
  • Insurance Pre-Authorization: Check coverage and authorization requirements
  • Real-time Dashboard: Monitor agent processing and view results
  • Slack Integration: Automatic notifications for completed intakes

Tech Stack

  • Frontend: Next.js 16, React 19, TailwindCSS v4
  • Database: PostgreSQL with Prisma ORM
  • AI: OpenAI GPT-4, RAG with vector embeddings
  • Speech: Google Cloud Speech-to-Text
  • External Integration: Slack Web API
  • HTTP Client: Axios

Prerequisites

  1. Node.js 18+ installed
  2. PostgreSQL database running locally
  3. OpenAI API key
  4. Google Cloud account with Speech-to-Text API enabled
  5. Slack workspace with bot token (optional)

Setup Instructions

1. Database Setup

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your actual credentials

# Create database
createdb healthcare_agents

# Run Prisma migrations
npm run prisma:generate
npm run prisma:migrate

# Seed database with sample data
npm run prisma:seed

2. Google Cloud Speech-to-Text Setup

  1. Go to Google Cloud Console
  2. Create a new project or select existing
  3. Enable Speech-to-Text API
  4. Create a service account and download JSON credentials
  5. Set GOOGLE_APPLICATION_CREDENTIALS in .env to the path of your JSON file

3. OpenAI Setup

  1. Get your API key from OpenAI Platform
  2. Set OPENAI_API_KEY in .env

4. Slack Setup (Optional)

  1. Create a Slack app at api.slack.com/apps
  2. Add Bot Token Scopes: chat:write, files:write
  3. Install app to workspace
  4. Copy Bot User OAuth Token to SLACK_BOT_TOKEN in .env
  5. Get channel ID and set SLACK_CHANNEL_ID

5. Run the Application

npm run dev

Visit http://localhost:3000

Usage

  1. Upload Audio: Click the microphone icon or drag-drop an audio file
  2. Transcription: System automatically transcribes audio using Google Speech-to-Text
  3. Agent Processing: Multi-agent workflow processes the intake:
    • Patient information extraction
    • Visit type classification
    • Medical code assignment (CPT/ICD-10)
    • Insurance authorization check
  4. View Results: Real-time dashboard shows processing status and results
  5. Slack Notification: Automatic notification sent to configured Slack channel

Architecture

Voice Input → Transcription → Multi-Agent Orchestrator
                                      ↓
                    ┌─────────────────┼─────────────────┐
                    ↓                 ↓                 ↓
            Patient Intake    Medical Coding    Insurance Check
                Agent              Agent              Agent
                    ↓                 ↓                 ↓
                    └─────────────────┼─────────────────┘
                                      ↓
                            Dashboard + Slack

Database Schema

  • Patient: Patient demographics and insurance info
  • IntakeSession: Main workflow tracking table
  • MedicalCode: CPT and ICD-10 code assignments
  • InsurancePreAuth: Authorization check results
  • AgentLog: Detailed execution logs for each agent
  • MedicalDocument: RAG knowledge base documents

API Endpoints

  • POST /api/intake/transcribe: Upload audio for transcription
  • POST /api/intake/process: Process transcribed text through agent workflow
  • GET /api/intake/sessions: Get all intake sessions
  • GET /api/intake/sessions/:id: Get specific session details
  • GET /api/dashboard/stats: Get dashboard statistics

Development

# View database in Prisma Studio
npm run prisma:studio

# Generate Prisma client after schema changes
npm run prisma:generate

# Create new migration
npm run prisma:migrate

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors