# svajpayee15/ami architecture

> Architecture diagram of the GitHub repository svajpayee15/ami, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/svajpayee15/ami
- Repository: https://github.com/svajpayee15/ami

## Overview

AMI is an Android digital caretaker for older and low-tech-literacy users. Its central workflow schedules medicine check-ins, guides the user through a call-like conversation, records adherence and symptoms, produces caretaker guidance, and escalates concerns to family. Separate capabilities provide screen-reading navigation, health and wellbeing views, and five relaxation activities. The README documents these product flows; app implementation excerpts were not provided, so app relationships below reflect documented behavior rather than inspected call sites. The escalation server excerpt shows its email and phone-call endpoints.

Main entry points: [`app/src/main/java/com/example/ami/caretaker/CaretakerAgent.kt`](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/caretaker/CaretakerAgent.kt) (Caretaker agent), [`app/src/main/java/com/example/ami/AmiPlannerManager.kt`](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/AmiPlannerManager.kt) (Navigation planner), [`server/index.js`](https://github.com/svajpayee15/ami/blob/main/server/index.js) (Notification service), [`app/src/main/java/com/example/ami/call/AmiCallActivity.kt`](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/call/AmiCallActivity.kt) (Medicine call)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guided["Guided navigation"]
  node_main["App home<br/>[MainActivity.kt]"]
  node_accessibility["Screen reader"]
  node_planner["Navigation planner"]
  node_gemini["Gemini wire<br/>[GeminiWire.kt]"]
  node_cursor["Guidance cursor"]
end

subgraph group_care["Check-ins and care"]
  node_scheduler["Medicine scheduler"]
  node_call["Medicine call<br/>[AmiCallActivity.kt]"]
  node_conversation["Nurse conversation"]
  node_caretaker["Caretaker agent<br/>[CaretakerAgent.kt]"]
  node_symptoms["Symptom extraction"]
  node_digest["Symptom digest<br/>[SymptomDigest.kt]"]
  node_guidance["Diet advice<br/>[DietAdvisor.kt]"]
end

subgraph group_health["Health and wellbeing"]
  node_vitals["Vitals assessment"]
  node_healthrepo["Health repository"]
  node_wellbeing["Wellbeing insights"]
end

subgraph group_activities["Relaxation activities"]
  node_games["Relaxation activities<br/>[GamesActivity.kt]"]
end

subgraph group_notify["Family escalation"]
  node_escalation["Escalation client"]
  node_api["Escalation API<br/>[EscalationApi.kt]"]
  node_backend["Notification service<br/>[index.js]"]
end

node_user(("Older adult"))
node_family(("Caregivers"))
node_email["Email service"]
node_twilio["Twilio"]

node_user -->|"uses"| node_main
node_main -.->|"enables guidance"| node_accessibility
node_accessibility -->|"requests next step"| node_planner
node_planner -->|"asks what to tap"| node_gemini
node_planner -->|"points to target"| node_cursor
node_scheduler -->|"rings at dose time"| node_call
node_user -->|"answers check-in"| node_call
node_call -->|"conducts dialogue"| node_conversation
node_conversation -->|"provides answers"| node_caretaker
node_caretaker -->|"extracts symptoms"| node_symptoms
node_symptoms -->|"counts by day"| node_digest
node_caretaker -->|"derives suggestions"| node_guidance
node_user -.->|"views health data"| node_healthrepo
node_healthrepo -.->|"assesses readings"| node_vitals
node_user -.->|"views trends"| node_wellbeing
node_user -->|"plays activities"| node_games
node_caretaker -->|"requests escalation"| node_escalation
node_escalation -.->|"sends request"| node_api
node_api -.->|"calls service"| node_backend
node_backend -->|"sends messages"| node_email
node_backend -->|"places calls"| node_twilio
node_email -.->|"delivers email"| node_family
node_twilio -.->|"calls caregiver"| node_family

click node_main "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/MainActivity.kt"
click node_accessibility "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/AmiAccessibilityService.kt"
click node_planner "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/AmiPlannerManager.kt"
click node_gemini "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/GeminiWire.kt"
click node_cursor "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/AmiCursorManager.kt"
click node_scheduler "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/reminders/MedicineAlarmScheduler.kt"
click node_call "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/call/AmiCallActivity.kt"
click node_conversation "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/call/NurseConversation.kt"
click node_caretaker "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/caretaker/CaretakerAgent.kt"
click node_symptoms "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/caretaker/SymptomExtractor.kt"
click node_digest "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/caretaker/SymptomDigest.kt"
click node_guidance "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/health/DietAdvisor.kt"
click node_vitals "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/health/VitalsAssessment.kt"
click node_healthrepo "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/health/HealthRepository.kt"
click node_wellbeing "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/wellbeing/WellbeingRepository.kt"
click node_games "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/games/GamesActivity.kt"
click node_escalation "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/escalation/EscalationClient.kt"
click node_api "https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/escalation/EscalationApi.kt"
click node_backend "https://github.com/svajpayee15/ami/blob/main/server/index.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_accessibility,node_planner,node_gemini,node_cursor toneBlue
class node_scheduler,node_call,node_conversation,node_caretaker,node_symptoms,node_digest,node_guidance toneAmber
class node_vitals,node_healthrepo,node_wellbeing toneMint
class node_games toneRose
class node_escalation,node_api,node_backend,node_user,node_family,node_email,node_twilio toneIndigo
```

## Components

### Guided navigation

- [App home](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/MainActivity.kt): `app/src/main/java/com/example/ami/MainActivity.kt`
- [Screen reader](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/AmiAccessibilityService.kt): `app/src/main/java/com/example/ami/AmiAccessibilityService.kt`
- [Navigation planner](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/AmiPlannerManager.kt): `app/src/main/java/com/example/ami/AmiPlannerManager.kt`
- [Gemini wire](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/GeminiWire.kt): `app/src/main/java/com/example/ami/GeminiWire.kt`
- [Guidance cursor](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/AmiCursorManager.kt): `app/src/main/java/com/example/ami/AmiCursorManager.kt`

### Check-ins and care

- [Medicine scheduler](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/reminders/MedicineAlarmScheduler.kt): `app/src/main/java/com/example/ami/reminders/MedicineAlarmScheduler.kt`
- [Medicine call](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/call/AmiCallActivity.kt): `app/src/main/java/com/example/ami/call/AmiCallActivity.kt`
- [Nurse conversation](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/call/NurseConversation.kt): `app/src/main/java/com/example/ami/call/NurseConversation.kt`
- [Caretaker agent](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/caretaker/CaretakerAgent.kt): `app/src/main/java/com/example/ami/caretaker/CaretakerAgent.kt`
- [Symptom extraction](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/caretaker/SymptomExtractor.kt): `app/src/main/java/com/example/ami/caretaker/SymptomExtractor.kt`
- [Symptom digest](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/caretaker/SymptomDigest.kt): `app/src/main/java/com/example/ami/caretaker/SymptomDigest.kt`
- [Diet advice](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/health/DietAdvisor.kt): `app/src/main/java/com/example/ami/health/DietAdvisor.kt`

### Health and wellbeing

- [Vitals assessment](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/health/VitalsAssessment.kt): `app/src/main/java/com/example/ami/health/VitalsAssessment.kt`
- [Health repository](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/health/HealthRepository.kt): `app/src/main/java/com/example/ami/health/HealthRepository.kt`
- [Wellbeing insights](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/wellbeing/WellbeingRepository.kt): `app/src/main/java/com/example/ami/wellbeing/WellbeingRepository.kt`

### Relaxation activities

- [Relaxation activities](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/games/GamesActivity.kt): `app/src/main/java/com/example/ami/games/GamesActivity.kt`

### Family escalation

- [Escalation client](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/escalation/EscalationClient.kt): `app/src/main/java/com/example/ami/escalation/EscalationClient.kt`
- [Escalation API](https://github.com/svajpayee15/ami/blob/main/app/src/main/java/com/example/ami/escalation/EscalationApi.kt): `app/src/main/java/com/example/ami/escalation/EscalationApi.kt`
- [Notification service](https://github.com/svajpayee15/ami/blob/main/server/index.js): `server/index.js`

### Other components

- **Older adult**
- **Caregivers**
- **Email service**
- **Twilio**

## Connections

- Older adult → App home: uses (evidence: `README.md`)
- App home → Screen reader: enables guidance
- Screen reader → Navigation planner: requests next step (evidence: `README.md`)
- Navigation planner → Gemini wire: asks what to tap (evidence: `README.md`)
- Navigation planner → Guidance cursor: points to target (evidence: `README.md`)
- Medicine scheduler → Medicine call: rings at dose time (evidence: `README.md`)
- Older adult → Medicine call: answers check-in (evidence: `README.md`)
- Medicine call → Nurse conversation: conducts dialogue (evidence: `README.md`)
- Nurse conversation → Caretaker agent: provides answers (evidence: `README.md`)
- Caretaker agent → Symptom extraction: extracts symptoms (evidence: `README.md`)
- Symptom extraction → Symptom digest: counts by day (evidence: `README.md`)
- Caretaker agent → Diet advice: derives suggestions (evidence: `README.md`)
- Older adult → Health repository: views health data
- Health repository → Vitals assessment: assesses readings
- Older adult → Wellbeing insights: views trends
- Older adult → Relaxation activities: plays activities (evidence: `README.md`)
- Caretaker agent → Escalation client: requests escalation (evidence: `README.md`)
- Escalation client → Escalation API: sends request
- Escalation API → Notification service: calls service
- Notification service → Email service: sends messages (evidence: `server/index.js`)
- Notification service → Twilio: places calls (evidence: `server/index.js`)
- Email service → Caregivers: delivers email
- Twilio → Caregivers: calls caregiver
