# its-aiman434/ai-voice-assistant architecture

> Architecture diagram of the GitHub repository its-aiman434/ai-voice-assistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/its-aiman434/ai-voice-assistant
- Repository: https://github.com/its-aiman434/ai-voice-assistant

## Overview

Xyrix is a desktop voice assistant with a web-based interface and Python command backend. Its primary workflow captures a voice or text command, sends it through the Eel bridge for interpretation and task execution, then displays and speaks the response. The documented capabilities also include drawing, PIN-protected sessions, chat history, app and web control, and WhatsApp actions. The sampled excerpts show the bridge and several command paths; some README capabilities, including emotion recognition and hotword detection, could not be traced to sampled implementation.

Main entry points: [`main.py`](https://github.com/its-aiman434/ai-voice-assistant/blob/main/main.py) (Eel bridge), [`command.py`](https://github.com/its-aiman434/ai-voice-assistant/blob/main/command.py) (Command dispatcher), [`web/script.js`](https://github.com/its-aiman434/ai-voice-assistant/blob/main/web/script.js) (UI interaction), [`web/index.html`](https://github.com/its-aiman434/ai-voice-assistant/blob/main/web/index.html) (Assistant UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Assistant interface"]
  node_webui["Assistant UI<br/>[index.html]"]
  node_webscript["UI interaction<br/>[script.js]"]
  node_visuals["UI animation<br/>[controller.js]"]
  node_localstate[("PIN and history<br/>[script.js]")]
  node_drawing["Drawing canvas<br/>[script.js]"]
end

subgraph group_backend["Command backend"]
  node_bridge["Eel bridge<br/>[main.py]"]
  node_voiceinput["Voice capture<br/>[command.py]"]
  node_dispatcher["Command dispatcher<br/>[command.py]"]
  node_speechoutput["Spoken response<br/>[command.py]"]
end

subgraph group_actions["Assistant actions"]
  node_appcontrol["App control<br/>[command.py]"]
  node_websearch["Web search<br/>[command.py]"]
  node_chat["AI chat<br/>[command.py]"]
  node_whatsapp["WhatsApp actions<br/>[command.py]"]
end

subgraph group_integrations["External systems"]
  node_recognizer["SpeechRecognition"]
  node_tts["pyttsx3"]
  node_aiapi["DeepInfra API"]
  node_web["Web browser"]
  node_desktop["Desktop apps"]
  node_whatsappapp["WhatsApp desktop"]
end

node_user(("User"))

node_user -->|"uses"| node_webui
node_webui -->|"loads"| node_webscript
node_webui -->|"loads"| node_visuals
node_webscript -->|"reads/writes"| node_localstate
node_webscript -->|"draws on"| node_drawing
node_webscript -->|"calls"| node_bridge
node_bridge -->|"calls"| node_voiceinput
node_voiceinput -->|"captures speech"| node_recognizer
node_voiceinput -->|"returns command"| node_bridge
node_bridge -->|"calls"| node_dispatcher
node_dispatcher -->|"returns response"| node_bridge
node_bridge -->|"calls"| node_speechoutput
node_speechoutput -->|"speaks with"| node_tts
node_dispatcher -->|"dispatches"| node_appcontrol
node_appcontrol -->|"launches"| node_desktop
node_dispatcher -->|"dispatches"| node_websearch
node_websearch -->|"searches"| node_web
node_dispatcher -->|"dispatches"| node_chat
node_chat -->|"requests answer"| node_aiapi
node_dispatcher -->|"dispatches"| node_whatsapp
node_bridge -->|"calls"| node_whatsapp
node_whatsapp -->|"automates"| node_whatsappapp
node_bridge -->|"returns response"| node_webscript

click node_webui "https://github.com/its-aiman434/ai-voice-assistant/blob/main/web/index.html"
click node_webscript "https://github.com/its-aiman434/ai-voice-assistant/blob/main/web/script.js"
click node_visuals "https://github.com/its-aiman434/ai-voice-assistant/blob/main/web/controller.js"
click node_localstate "https://github.com/its-aiman434/ai-voice-assistant/blob/main/web/script.js"
click node_bridge "https://github.com/its-aiman434/ai-voice-assistant/blob/main/main.py"
click node_voiceinput "https://github.com/its-aiman434/ai-voice-assistant/blob/main/command.py"
click node_dispatcher "https://github.com/its-aiman434/ai-voice-assistant/blob/main/command.py"
click node_speechoutput "https://github.com/its-aiman434/ai-voice-assistant/blob/main/command.py"
click node_appcontrol "https://github.com/its-aiman434/ai-voice-assistant/blob/main/command.py"
click node_websearch "https://github.com/its-aiman434/ai-voice-assistant/blob/main/command.py"
click node_chat "https://github.com/its-aiman434/ai-voice-assistant/blob/main/command.py"
click node_whatsapp "https://github.com/its-aiman434/ai-voice-assistant/blob/main/command.py"
click node_drawing "https://github.com/its-aiman434/ai-voice-assistant/blob/main/web/script.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_webui,node_webscript,node_visuals,node_localstate,node_drawing,node_user toneBlue
class node_bridge,node_voiceinput,node_dispatcher,node_speechoutput toneAmber
class node_appcontrol,node_websearch,node_chat,node_whatsapp toneMint
class node_recognizer,node_tts,node_aiapi,node_web,node_desktop,node_whatsappapp toneRose
```

## Components

### Assistant interface

- [Assistant UI](https://github.com/its-aiman434/ai-voice-assistant/blob/main/web/index.html): `web/index.html`
- [UI interaction](https://github.com/its-aiman434/ai-voice-assistant/blob/main/web/script.js): `web/script.js`
- [UI animation](https://github.com/its-aiman434/ai-voice-assistant/blob/main/web/controller.js): `web/controller.js`
- [PIN and history](https://github.com/its-aiman434/ai-voice-assistant/blob/main/web/script.js): `web/script.js`
- [Drawing canvas](https://github.com/its-aiman434/ai-voice-assistant/blob/main/web/script.js): `web/script.js`

### Command backend

- [Eel bridge](https://github.com/its-aiman434/ai-voice-assistant/blob/main/main.py): `main.py`
- [Voice capture](https://github.com/its-aiman434/ai-voice-assistant/blob/main/command.py): `command.py`
- [Command dispatcher](https://github.com/its-aiman434/ai-voice-assistant/blob/main/command.py): `command.py`
- [Spoken response](https://github.com/its-aiman434/ai-voice-assistant/blob/main/command.py): `command.py`

### Assistant actions

- [App control](https://github.com/its-aiman434/ai-voice-assistant/blob/main/command.py): `command.py`
- [Web search](https://github.com/its-aiman434/ai-voice-assistant/blob/main/command.py): `command.py`
- [AI chat](https://github.com/its-aiman434/ai-voice-assistant/blob/main/command.py): `command.py`
- [WhatsApp actions](https://github.com/its-aiman434/ai-voice-assistant/blob/main/command.py): `command.py`

### External systems

- **SpeechRecognition**
- **pyttsx3**
- **DeepInfra API**
- **Web browser**
- **Desktop apps**
- **WhatsApp desktop**

### Other components

- **User**

## Connections

- User → Assistant UI: uses
- Assistant UI → UI interaction: loads
- Assistant UI → UI animation: loads
- UI interaction → PIN and history: reads/writes
- UI interaction → Drawing canvas: draws on
- UI interaction → Eel bridge: calls
- Eel bridge → Voice capture: calls
- Voice capture → SpeechRecognition: captures speech
- Voice capture → Eel bridge: returns command
- Eel bridge → Command dispatcher: calls
- Command dispatcher → Eel bridge: returns response
- Eel bridge → Spoken response: calls
- Spoken response → pyttsx3: speaks with
- Command dispatcher → App control: dispatches
- App control → Desktop apps: launches
- Command dispatcher → Web search: dispatches
- Web search → Web browser: searches
- Command dispatcher → AI chat: dispatches
- AI chat → DeepInfra API: requests answer
- Command dispatcher → WhatsApp actions: dispatches
- Eel bridge → WhatsApp actions: calls
- WhatsApp actions → WhatsApp desktop: automates
- Eel bridge → UI interaction: returns response
