An AI-powered multi-agent system for automating medical coding, patient intake triage, and insurance pre-authorization.
- 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
- 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
- Node.js 18+ installed
- PostgreSQL database running locally
- OpenAI API key
- Google Cloud account with Speech-to-Text API enabled
- Slack workspace with bot token (optional)
# 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- Go to Google Cloud Console
- Create a new project or select existing
- Enable Speech-to-Text API
- Create a service account and download JSON credentials
- Set
GOOGLE_APPLICATION_CREDENTIALSin.envto the path of your JSON file
- Get your API key from OpenAI Platform
- Set
OPENAI_API_KEYin.env
- Create a Slack app at api.slack.com/apps
- Add Bot Token Scopes:
chat:write,files:write - Install app to workspace
- Copy Bot User OAuth Token to
SLACK_BOT_TOKENin.env - Get channel ID and set
SLACK_CHANNEL_ID
npm run devVisit http://localhost:3000
- Upload Audio: Click the microphone icon or drag-drop an audio file
- Transcription: System automatically transcribes audio using Google Speech-to-Text
- Agent Processing: Multi-agent workflow processes the intake:
- Patient information extraction
- Visit type classification
- Medical code assignment (CPT/ICD-10)
- Insurance authorization check
- View Results: Real-time dashboard shows processing status and results
- Slack Notification: Automatic notification sent to configured Slack channel
Voice Input → Transcription → Multi-Agent Orchestrator
↓
┌─────────────────┼─────────────────┐
↓ ↓ ↓
Patient Intake Medical Coding Insurance Check
Agent Agent Agent
↓ ↓ ↓
└─────────────────┼─────────────────┘
↓
Dashboard + Slack
- 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
POST /api/intake/transcribe: Upload audio for transcriptionPOST /api/intake/process: Process transcribed text through agent workflowGET /api/intake/sessions: Get all intake sessionsGET /api/intake/sessions/:id: Get specific session detailsGET /api/dashboard/stats: Get dashboard statistics
# 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:migrateMIT