An intelligent, voice-powered medical intake system that revolutionizes patient interactions through AI-driven conversations. Built with Next.js, TypeScript, and Supabase for scalable, real-time healthcare solutions.
- AI-Powered Conversations: Intelligent bots handle patient intake with natural language processing
- Voice Integration: Seamless webhook-based voice call handling with Twilio
- Patient Management: Comprehensive patient database with medical ID tracking
- Real-time Analytics: Live call monitoring and detailed conversation logs
- Multi-Domain Support: Configurable for medical, legal, and receptionist use cases
- Serverless API: RESTful endpoints for bot management and webhook processing
- Database Integration: PostgreSQL via Supabase with real-time subscriptions
- Security First: Webhook signature validation and rate limiting
- Monitoring: Built-in performance tracking and error handling
- Scalable Design: Modular architecture supporting multiple bot instances
- Bot Management: Create, update, and monitor AI assistants
- Call History: Detailed analytics of all patient interactions
- Real-time Status: Live system health indicators
- Domain Flexibility: Support for medical, legal, and general domains
- Node.js 18+
- npm/yarn/pnpm
- Supabase account
- OpenMic account (for voice features)
-
Clone the repository
git clone https://github.com/your-username/ai-intake-agent.git cd ai-intake-agent -
Install dependencies
npm install # or yarn install # or pnpm install
-
Environment Setup
cp .env.example .env.local
Configure your environment variables:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key SUPABASE_SERVICE_ROLE_KEY=your_service_role_key WEBHOOK_SECRET=your_webhook_secret NEXT_PUBLIC_APP_URL=http://localhost:3000
-
Database Setup
# Run the schema.sql in your Supabase dashboard # Or use Supabase CLI npx supabase db push
-
Run the development server
npm run dev # or yarn dev # or pnpm dev
-
Open your browser
http://localhost:3000
├── src/
│ ├── app/
│ │ ├── api/
│ │ │ ├── bots/ # Bot CRUD operations
│ │ │ ├── call-logs/ # Call history management
│ │ │ ├── functions/ # Patient data functions
│ │ │ └── webhooks/ # Voice call webhooks
│ │ ├── favicon.ico
│ │ ├── globals.css
│ │ ├── layout.tsx
│ │ └── page.tsx # Main dashboard
│ ├── lib/
│ │ ├── auth.ts # Authentication utilities
│ │ ├── env.ts # Environment configuration
│ │ ├── monitoring.ts # Performance monitoring
│ │ ├── patient.ts # Patient data handling
│ │ ├── rate-limit.ts # API rate limiting
│ │ ├── supabase.ts # Database client
│ │ ├── validation.ts # Request validation
│ │ └── webhook.ts # Webhook processing
│ └── middleware.ts # Next.js middleware
├── public/ # Static assets
├── schema.sql # Database schema
└── README.md
GET /api/bots- List all botsPOST /api/bots- Create a new botGET /api/bots/[id]- Get bot detailsPUT /api/bots/[id]- Update botDELETE /api/bots/[id]- Delete bot
GET /api/call-logs- Retrieve call history
POST /api/webhooks/pre-call- Pre-call patient lookupPOST /api/webhooks/post-call- Post-call data logging
POST /api/functions/fetch-patient- Patient data retrieval
- Connect your GitHub repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push
npm run build
npm startConfigure your voice platform (OpenMic) webhooks:
- Pre-call:
https://your-domain.com/api/webhooks/pre-call - Post-call:
https://your-domain.com/api/webhooks/post-call
- Webhook Validation: HMAC signature verification
- Rate Limiting: API protection against abuse
- Authentication: Secure bot management
- Data Encryption: Secure patient data handling
Built-in monitoring includes:
- API response times
- Error tracking
- Call success rates
- Database performance
Built with ❤️ for healthcare innovation