Skip to content

jinan-kordab/clinical-intake

Repository files navigation

Clinical Intake -- AI Pre-Consultation Voice Agent

Architecture and implementation by Jinan Kordab. Copyright (c) 2026. All rights reserved.

Anonymous clinical interviewing pipeline with automated podcast generation.

Docker Node Tests License


video.mp4

Overview

A production-grade voice agent that automates pre-consultation clinical intake. The LLM conducts a structured interview by asking clinical questions aloud; the patient responds by speaking into a microphone. Every response is transcribed, analyzed, and synthesized into a structured audio podcast for physician review.

The system is designed for speed, privacy, and operational simplicity. A complete clinical questionnaire is processed in under three minutes from start to podcast delivery.

Patient Intake Interface


Architecture

Patient (Microphone)
      |
      | Web Audio Capture
      v
+------------------+      +------------------+      +------------------+
|   Groq STT       |----->|   LLM            |----->| ElevenLabs TTS   |
| Speech-to-Text   |      | Clinical Logic   |      | Text-to-Speech   |
+------------------+      +------------------+      +------------------+
                                    |                        |
                                    | Structured Data        | Audio Reply
                                    v                        v
                           +------------------+      Patient (Speaker)
                           |   SESSIONS/      |
                           | Podcast + Audio  |
                           +------------------+
                                    |
                                    | MP3 Download
                                    v
                           +------------------+
                           | Physician Review |
                           | (JWT Dashboard)  |
                           +------------------+

Pipeline flow: The LLM asks a clinical question via TTS. The patient answers by voice. Groq transcribes the answer. The LLM evaluates the response and asks the next relevant question. After all questions are answered, the full encounter is compiled into a downloadable MP3 podcast.


What Differentiates This System

Capability Detail
Anonymous by Design No patient identifiers stored. Audio is processed transiently; only the final structured podcast persists.
Sub-3-Minute Pipeline End-to-end latency from first question to podcast delivery is kept under three minutes through model selection and pipeline optimization.
Full AI Stack Groq for real-time STT, LLM for clinical reasoning and question routing, ElevenLabs for neural TTS with natural prosody.
Bilingual French and English clinical questionnaires tailored to regional health authority requirements.
Auto-Generated Podcast Each encounter produces a structured MP3 combining all questions and responses as a narrative summary for the physician.
Single-Command Deploy docker compose up -d on any machine with Docker. No manual dependency installation required.
JWT-Secured Dashboard Physician access to encounter recordings and session history behind token-based authentication.

Quick Start

git clone https://github.com/your-org/clinical-intake.git
cd clinical-intake

cp .env.example .env
# Add your API keys: GROQ_API_KEY, LLM_API_KEY, ELEVENLABS_API_KEY

docker compose up -d
Role URL Auth
Patient Intake http://localhost:3000 None
Physician Login http://localhost:3000/login.html doctor / admin123

Physician Login


Environment Variables

Variable Purpose Provider
GROQ_API_KEY Speech-to-Text transcription groq.com
LLM_API_KEY Clinical reasoning and question generation Your LLM provider
ELEVENLABS_API_KEY Text-to-Speech voice synthesis elevenlabs.io
ADMIN_USER / ADMIN_PASSWORD Physician dashboard credentials Self-defined

Physician Dashboard - Encounter Summary


Completed Evaluation - French

Demo Recordings

The following MP3 files were generated by the system running inside Docker and downloaded from the container's SESSIONS/ volume. They represent complete clinical encounter podcasts as heard by the reviewing physician.

Recording Language Duration File
French Clinical Encounter French ~3 min session-fr.mp3
English Clinical Encounter English ~3 min session-en.mp3

Test Suite

npm install
npm test

Tests spawn a real Express server on port 3099 using mock API credentials. No external service connectivity is required.

Suite Tests Result
Health Endpoint 1 Passing
Authentication (login, JWT, rejection) 6 Passing
Session Management (create, list, auth-gate) 4 Passing
Chat Pipeline (audio validation) 2 Passing
Podcast Generation (guard conditions) 1 Passing
Session Reset 1 Passing
Static Asset Serving 4 Passing
Total 19 100% Passing

Project Structure

.
├── Dockerfile                  # Multi-stage build, Node 22 Alpine
├── docker-compose.yml          # Single-command orchestration
├── entrypoint.sh               # Runtime permission bootstrap
├── server.js                   # Express API, AI pipeline, JWT auth
├── package.json                # Dependencies and scripts
├── jest.config.json            # Test runner configuration
├── .env.example                # Environment template (no secrets)
├── .dockerignore
├── public/
│   ├── index.html              # Patient intake interface
│   ├── login.html              # Physician authentication
│   └── doctor.html             # Physician dashboard
├── questions/
│   ├── fr.txt / fr_test.txt    # French clinical questionnaire
│   └── en.txt / en_test.txt    # English clinical questionnaire
├── img/                        # Brand assets
├── demo/                       # Sample podcast recordings
└── tests/
    └── server.test.js          # 19 integration tests

License

MIT. Copyright (c) 2026 Jinan Kordab. See LICENSE.

About

AI-powered voice agent for pre-consultation clinical intake. Anonymous speech-to-podcast pipeline: Groq STT + LLM + ElevenLabs TTS. Bilingual (EN/FR). Sub-3-minute encounters. Docker one-command deploy.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors