Phil Gear philgear.dev
All Projects / ai / Pocket-Gull
ai Flagship
Published: 2025-01-20

Pocket-Gull

Clinical Intelligence & Full-Duplex Multimodal Consult Engine

Real-time medical Clinical Decision Support and Live Multimodal AI Consult engine powered by Google Gemini, Three.js 3D anatomy, and FHIR R4 interoperability.

Clinical Latency < 180ms
Anatomical Meshes 206 Bones Procedural
FHIR Compliance R4 Bundle Standard
AI Safety Filter Custom Clinical CDS
#Google Gemini #Angular 22 #Three.js #Node.js SSR #FHIR R4 #Tailwind CSS #FastAPI

Architecture Highlights

  • Frontend: Angular 22 with modern Signals reactivity and Standalone Components.
  • AI Layer: Google Gemini 2.5 via native REST, @google/adk InMemoryRunner, and Genkit pipelines.
  • 3D Spatial Engine: Procedural skeletal models and interactive dermatome shaders via Three.js.
  • Security & Interoperability: DOMPurify sanitization, HIPAA Safe Harbor de-identification, and FHIR R4.

Engineering Hurdles Solved

  • Preventing false-positive safety blocking on life-critical toxicology and emergency care plans by tailoring clinical CDS thresholds.
  • Maintaining 60 FPS Three.js rendering while processing high-frequency live WebSockets audio and telemetry streams.

Executive Overview

Pocket-Gull is a next-generation clinical decision support (CDS) and live multimodal AI consultation platform. Built for precision medicine, functional health, and real-time triage, Pocket-Gull fuses state-of-the-art generative intelligence with biophysical modeling and healthcare standards.

Key Architectural Breakthroughs

1. Full-Duplex Multimodal Consult Engine

Pocket-Gull leverages Google Gemini Live WebSocket streams to provide natural bi-directional voice consultation. The system handles low-latency audio capture, streaming transcription, clinical entity extraction, and continuous physiological telemetry visualization simultaneously.

2. Procedural 3D Skeletal & Surface Anatomy

Using Three.js, the application generates interactive skeletal and dermatome surface models directly in WebGL. Clinicians and patients can rotate, slice, and inspect localized pain nodes, anatomical anomalies, and symptom clusters in real-time 3D space.

// Sample signal-driven telemetry and 3D node activation
@Component({
  selector: 'app-anatomy-node',
  standalone: true,
  template: `
    <div class="p-3 neo-card bg-white dark:bg-zinc-900 border-2 border-blue-600">
      <span class="font-kanit font-bold text-blue-600">{{ anatomicalRegion() }}</span>
      <p class="text-sm text-zinc-600 dark:text-zinc-300">Severity Index: {{ severityScore() }}/10</p>
    </div>
  `
})
export class AnatomyNodeComponent {
  region = input.required<string>();
  severity = input<number>(0);
  
  anatomicalRegion = computed(() => this.region().toUpperCase());
  severityScore = computed(() => this.severity().toFixed(1));
}

3. FHIR R4 Bundle Serialization

Every symptom record, vitals timeline, and AI clinical report is serialized into strict HL7 FHIR R4 Bundle format, ensuring instantaneous interoperability with electronic health record (EHR) systems like Epic, Cerner, and OpenEMR.

Technology Stack

  • Client & SSR: Angular 22, TypeScript, Express SSR, Tailwind CSS.
  • AI & Reasoning: Google Gemini Pro & Flash, Genkit, ADK Live Streaming.
  • 3D Graphics: Three.js, WebGL Shader Language (GLSL).
  • Standards & Privacy: FHIR R4, DOMPurify, HIPAA §164.514 Safe Harbor De-identification.