# Sirona AI — Data, API, & Technology Disclosures

Sirona AI is designed with an offline-first, client-side triage model. To ensure clinical safety, privacy compliance, and dynamic user interfaces, the application integrates multiple third-party APIs, databases, browser specifications, and open-source libraries.

Below is a comprehensive disclosure of the technologies and data providers driving Sirona AI.

---

## 🔌 1. Third-Party API Integrations

Sirona AI utilizes external cognitive and audio synthesis APIs. All API calls are executed dynamically from the client's browser (or proxied via serverless layers) using values configured in the user's environment.

### **Groq Cloud API**
* **Purpose**: Drives the conversational AI triage engine, generates differential diagnostic trees, evaluates symptom descriptions, and runs the AI Wellbeing Chat Companion.
* **Model**: `meta-llama/llama-4-scout-17b-16e-instruct`
* **Endpoint**: `https://api.groq.com/openai/v1/chat/completions`
* **Data Transmitted**: User symptoms (text or speech transcriptions), pain scale ratings, selected body locations, age, gender, and base64-encoded visual symptom photos.

### **ElevenLabs API**
* **Purpose**: Generates high-fidelity, emotional text-to-speech audio streams for the AI Wellbeing Companion.
* **Model**: `eleven_monolingual_v1` ( Rachel, Adam, Nicole, Antoni voices)
* **Endpoint**: `https://api.elevenlabs.io/v1/text-to-speech/{voiceId}`
* **Data Transmitted**: Plaintext responses generated by the companion LLM.

### **Google Translate Widget API**
* **Purpose**: Provides instant multilingual local translation options for international users.
* **Source**: `https://translate.google.com/translate_a/element.js`
* **Data Transmitted**: Ephemeral page text strings for automatic language transformation.

---

## 🗄️ 2. Databases & Storage Architecture

Sirona AI operates a dual cloud-local database architecture to enable offline-first reliability while maintaining secure, real-time user backups.

### **Google Cloud Firebase Firestore**
* **Purpose**: Remote cloud document storage.
* **Collections Used**:
  * `/users/{uid}`: Profiles, language/region metadata, and emergency Medical IDs (age, blood type, allergies, medications, emergency contacts).
  * `/users/{uid}/consultations`: Urgency scores, differential diagnoses, SNOMED concept terms, and ICD-11 codes.
  * `/users/{uid}/symptom_logs`: Daily temperature, pulse, checked symptoms, mood index, and pain rating logs.

### **Web Storage (LocalStorage)**
* **Purpose**: Ephemeral sandboxing, session caching, and offline-first storage fallback when network connectivity is lost.
* **Namespaced Keys**:
  * `sirona_user`: Active guest or user auth credentials.
  * `sirona_theme`: Color theme preference (`dark`, `light`, or `system`).
  * `sirona_history`: Backup records of past triage reports.
  * `sirona_symptom_logs`: Log data queued for database sync.
  * `sirona_health_checklist`: Bookmarked goals and tasks.

---

## 🧬 3. Injected Medical Registry Datasets

To ground AI triage responses and prevent hallucinations, Sirona AI prompts are constructed to cross-reference terms and alerts from the following clinical repositories:

1. **PubMed (NLM)**: Academic research references and case files.
2. **OpenFDA**: Adverse drug reactions, generic names, and recall guidelines.
3. **World Health Organization (WHO)**: Global outbreak monitoring and travel alerts.
4. **CDC Surveillance**: Epidemic guidelines and vector profiles.
5. **NIH Guidelines**: Clinical practice benchmarks and recommended workups.
6. **ICD-11 (WHO)**: International code classification of diseases and morbidity.
7. **SNOMED CT**: Systematized medical vocabulary terminology maps.
8. **RxNorm (NLM)**: Clinical drug and ingredient nomenclature.
9. **DailyMed (FDA)**: Official pharmaceutical labeling inserts and contraindications.
10. **MedlinePlus (NLM)**: Layperson patient wellness education.

---

## 📊 4. Client Libraries & Web Specifications

### **Chart.js**
* **Purpose**: Renders data analytics visualizations on `dashboard.html` showing symptom frequencies, pain trends, and consultation frequency.

### **HTML2PDF.js**
* **Purpose**: Converts styled HTML document nodes into clean, print-ready A4 PDF files for patient downloads or doctor hand-offs.

### **Lottie-web**
* **Purpose**: Plays vector-based JSON animations for the interactive application splash loader screen.

### **Web Audio API**
* **Purpose**: Native web client-side synthesizer generating binaural drone wave oscillators (theta delta frequencies) and ambient soundscape mixers (rain, wind, ocean).

### **Web Speech API**
* **Purpose**: Provides browser-native voice transcription fallback (`webkitSpeechRecognition`) for hands-free symptom descriptions and native browser Text-to-Speech fallbacks.
