# raj14428o/sai architecture

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

- Interactive diagram: https://gitdiagram.com/raj14428o/sai
- Repository: https://github.com/raj14428o/sai

## Overview

Vision Mate combines voice assistance, walking guidance, face identification, and everyday tools. The main menu starts the voice assistant, standalone navigation, and face-recognition view; in voice mode, microphone input is routed by the controller to the selected capability, with spoken responses. Walking mode combines object detection, depth estimates, and navigation decisions. The README documents weather, email, reminders, notes, calculation, and device status. Some subsystem details are documented but their full implementations were not sampled, so those links rely on README evidence.

Main entry points: [`Communication/assistant/controller.py`](https://github.com/raj14428o/sai/blob/master/Communication/assistant/controller.py) (Command controller), [`obstacle_detection/detection_code_video.py`](https://github.com/raj14428o/sai/blob/master/obstacle_detection/detection_code_video.py) (Navigation video), [`main.py`](https://github.com/raj14428o/sai/blob/master/main.py) (Mode menu), [`Communication/modules/daily_tools.py`](https://github.com/raj14428o/sai/blob/master/Communication/modules/daily_tools.py) (Daily tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_launcher["Mode menu<br/>[main.py]"]
  node_voice_entry["Voice entry<br/>[main.py]"]
end

subgraph group_voice["Voice assistant"]
  node_controller["Command controller<br/>[controller.py]"]
  node_speech_input["Speech input<br/>[speech_input.py]"]
  node_speech_output["Speech output<br/>[speech_output.py]"]
  node_email["Email drafting"]
  node_contacts["Contact book<br/>[contacts.json]"]
end

subgraph group_navigation["Walking navigation"]
  node_navigation_video["Navigation video"]
  node_depth["Depth estimation<br/>[depth_estimator.py]"]
  node_nav_engine["Hazard guidance"]
end

subgraph group_faces["Face identification"]
  node_face_manager["Face manager<br/>[face_manager.py]"]
  node_face_view["Live face view"]
  node_face_training["Face training<br/>[face_manager.py]"]
  node_face_data["Training photos"]
end

subgraph group_tools["Productivity tools"]
  node_daily_tools["Daily tools<br/>[daily_tools.py]"]
  node_reminders[("Reminders<br/>[reminders.json]")]
  node_notes[("Notes<br/>[notes.json]")]
end

node_user(("User"))
node_gmail["Gmail SMTP"]
node_gemini["Gemini service"]
node_camera["Camera"]
node_weather["Weather service"]

node_user -->|"selects mode"| node_launcher
node_launcher -->|"starts voice"| node_voice_entry
node_launcher -->|"starts navigation"| node_navigation_video
node_launcher -->|"starts face view"| node_face_view
node_launcher -->|"starts retraining"| node_face_training
node_voice_entry -->|"runs commands"| node_controller
node_user -.->|"speaks commands"| node_speech_input
node_controller -->|"listens through"| node_speech_input
node_controller -->|"speaks responses"| node_speech_output
node_controller -->|"manages email"| node_email
node_email -->|"looks up"| node_contacts
node_email -->|"sends through"| node_gmail
node_controller -.->|"asks questions"| node_gemini
node_controller -->|"routes tool requests"| node_daily_tools
node_daily_tools -->|"reads and writes"| node_reminders
node_daily_tools -->|"reads and writes"| node_notes
node_daily_tools -.->|"fetches weather"| node_weather
node_controller -->|"starts walking mode"| node_navigation_video
node_navigation_video -->|"captures frames"| node_camera
node_navigation_video -->|"estimates depth"| node_depth
node_navigation_video -->|"updates guidance"| node_nav_engine
node_navigation_video -->|"speaks guidance"| node_speech_output
node_controller -->|"identifies faces"| node_face_manager
node_face_view -.->|"captures faces"| node_camera
node_face_training -->|"trains from photos"| node_face_data

click node_launcher "https://github.com/raj14428o/sai/blob/master/main.py"
click node_voice_entry "https://github.com/raj14428o/sai/blob/master/Communication/main.py"
click node_controller "https://github.com/raj14428o/sai/blob/master/Communication/assistant/controller.py"
click node_speech_input "https://github.com/raj14428o/sai/blob/master/Communication/voice/speech_input.py"
click node_speech_output "https://github.com/raj14428o/sai/blob/master/Communication/voice/speech_output.py"
click node_email "https://github.com/raj14428o/sai/blob/master/Communication/modules/communication_tool.py"
click node_contacts "https://github.com/raj14428o/sai/blob/master/Communication/contacts.json"
click node_navigation_video "https://github.com/raj14428o/sai/blob/master/obstacle_detection/detection_code_video.py"
click node_depth "https://github.com/raj14428o/sai/blob/master/obstacle_detection/depth_estimator.py"
click node_nav_engine "https://github.com/raj14428o/sai/blob/master/obstacle_detection/navigation_engine.py"
click node_face_manager "https://github.com/raj14428o/sai/blob/master/opencv/Faces/face_manager.py"
click node_face_view "https://github.com/raj14428o/sai/blob/master/opencv/Faces/face_recognition.py"
click node_face_training "https://github.com/raj14428o/sai/blob/master/opencv/Faces/face_manager.py"
click node_face_data "https://github.com/raj14428o/sai/tree/master/opencv/Resources/Faces/train"
click node_daily_tools "https://github.com/raj14428o/sai/blob/master/Communication/modules/daily_tools.py"
click node_reminders "https://github.com/raj14428o/sai/blob/master/Communication/reminders.json"
click node_notes "https://github.com/raj14428o/sai/blob/master/Communication/notes.json"

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_launcher,node_voice_entry,node_user toneBlue
class node_controller,node_speech_input,node_speech_output,node_email,node_contacts toneAmber
class node_navigation_video,node_depth,node_nav_engine toneMint
class node_face_manager,node_face_view,node_face_training,node_face_data toneRose
class node_daily_tools,node_reminders,node_notes,node_gmail,node_gemini,node_camera,node_weather toneIndigo
```

## Components

### Application entry

- [Mode menu](https://github.com/raj14428o/sai/blob/master/main.py): `main.py`
- [Voice entry](https://github.com/raj14428o/sai/blob/master/Communication/main.py): `Communication/main.py`

### Voice assistant

- [Command controller](https://github.com/raj14428o/sai/blob/master/Communication/assistant/controller.py): `Communication/assistant/controller.py`
- [Speech input](https://github.com/raj14428o/sai/blob/master/Communication/voice/speech_input.py): `Communication/voice/speech_input.py`
- [Speech output](https://github.com/raj14428o/sai/blob/master/Communication/voice/speech_output.py): `Communication/voice/speech_output.py`
- [Email drafting](https://github.com/raj14428o/sai/blob/master/Communication/modules/communication_tool.py): `Communication/modules/communication_tool.py`
- [Contact book](https://github.com/raj14428o/sai/blob/master/Communication/contacts.json): `Communication/contacts.json`

### Walking navigation

- [Navigation video](https://github.com/raj14428o/sai/blob/master/obstacle_detection/detection_code_video.py): `obstacle_detection/detection_code_video.py`
- [Depth estimation](https://github.com/raj14428o/sai/blob/master/obstacle_detection/depth_estimator.py): `obstacle_detection/depth_estimator.py`
- [Hazard guidance](https://github.com/raj14428o/sai/blob/master/obstacle_detection/navigation_engine.py): `obstacle_detection/navigation_engine.py`

### Face identification

- [Face manager](https://github.com/raj14428o/sai/blob/master/opencv/Faces/face_manager.py): `opencv/Faces/face_manager.py`
- [Live face view](https://github.com/raj14428o/sai/blob/master/opencv/Faces/face_recognition.py): `opencv/Faces/face_recognition.py`
- [Face training](https://github.com/raj14428o/sai/blob/master/opencv/Faces/face_manager.py): `opencv/Faces/face_manager.py`
- [Training photos](https://github.com/raj14428o/sai/tree/master/opencv/Resources/Faces/train): `opencv/Resources/Faces/train`

### Productivity tools

- [Daily tools](https://github.com/raj14428o/sai/blob/master/Communication/modules/daily_tools.py): `Communication/modules/daily_tools.py`
- [Reminders](https://github.com/raj14428o/sai/blob/master/Communication/reminders.json): `Communication/reminders.json`
- [Notes](https://github.com/raj14428o/sai/blob/master/Communication/notes.json): `Communication/notes.json`

### Other components

- **User**
- **Gmail SMTP**
- **Gemini service**
- **Camera**
- **Weather service**

## Connections

- User → Mode menu: selects mode (evidence: `main.py`)
- Mode menu → Voice entry: starts voice (evidence: `main.py`)
- Mode menu → Navigation video: starts navigation (evidence: `main.py`)
- Mode menu → Live face view: starts face view (evidence: `main.py`)
- Mode menu → Face training: starts retraining (evidence: `main.py`)
- Voice entry → Command controller: runs commands (evidence: `Communication/main.py`)
- User → Speech input: speaks commands (evidence: `README.md`)
- Command controller → Speech input: listens through (evidence: `Communication/assistant/controller.py`)
- Command controller → Speech output: speaks responses (evidence: `Communication/assistant/controller.py`)
- Command controller → Email drafting: manages email (evidence: `Communication/assistant/controller.py`)
- Email drafting → Contact book: looks up (evidence: `Communication/modules/communication_tool.py`)
- Email drafting → Gmail SMTP: sends through (evidence: `Communication/modules/communication_tool.py`)
- Command controller → Gemini service: asks questions (evidence: `README.md`)
- Command controller → Daily tools: routes tool requests (evidence: `Communication/assistant/controller.py`)
- Daily tools → Reminders: reads and writes (evidence: `Communication/modules/daily_tools.py`)
- Daily tools → Notes: reads and writes (evidence: `Communication/modules/daily_tools.py`)
- Daily tools → Weather service: fetches weather (evidence: `README.md`)
- Command controller → Navigation video: starts walking mode (evidence: `Communication/assistant/controller.py`)
- Navigation video → Camera: captures frames (evidence: `obstacle_detection/detection_code_video.py`)
- Navigation video → Depth estimation: estimates depth (evidence: `obstacle_detection/detection_code_video.py`)
- Navigation video → Hazard guidance: updates guidance (evidence: `obstacle_detection/detection_code_video.py`)
- Navigation video → Speech output: speaks guidance (evidence: `obstacle_detection/detection_code_video.py`)
- Command controller → Face manager: identifies faces (evidence: `Communication/assistant/controller.py`)
- Live face view → Camera: captures faces (evidence: `README.md`)
- Face training → Training photos: trains from photos (evidence: `opencv/Faces/face_manager.py`)
