# ankush-naskar/jarvis-voice-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/ankush-naskar/jarvis-voice-assistant
- Repository: https://github.com/ankush-naskar/jarvis-voice-assistant

## Overview

Jarvis is a desktop voice assistant with a GUI and a voice-command loop. Its principal workflow is microphone capture and speech recognition, command dispatch, then local browser actions, weather retrieval, or optional AI responses, with spoken feedback. The GUI can start/stop the engine and edit settings; settings and bookmarks are loaded from JSON. Edges follow the excerpts and README. The README documents capabilities such as Google/YouTube search, forecasts, AI, notifications and inactivity shutdown; unsampled details are represented only where their relationship is documented.

Main entry points: [`modules/engine.py`](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/engine.py) (Assistant engine), [`modules/data_handler/data_handling.py`](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/data_handler/data_handling.py) (Settings and bookmarks), [`modules/voice/speech.py`](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/voice/speech.py) (Speech output), [`modules/commands/core.py`](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/commands/core.py) (Command dispatcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_main_gui["Main window<br/>[main_interface.py]"]
  node_settings_gui["Settings window"]
  node_gui_elements["GUI elements<br/>[gui_elements.py]"]
  node_help_window["Help popup<br/>[help_window.py]"]
end

subgraph group_runtime["Assistant runtime"]
  node_engine["Assistant engine<br/>[engine.py]"]
  node_listener["Voice listener<br/>[listener.py]"]
  node_commands["Command dispatcher<br/>[core.py]"]
  node_speech["Speech output<br/>[speech.py]"]
end

subgraph group_actions["Command capabilities"]
  node_browser["Browser and media<br/>[browser_cmd.py]"]
  node_weather_cmd["Weather commands<br/>[weather_cmd.py]"]
  node_weather["Forecast service<br/>[weather.py]"]
  node_ai["AI responses<br/>[ai_service.py]"]
end

subgraph group_support["Shared services"]
  node_data[("Settings and bookmarks<br/>[data_handling.py]")]
  node_notify["Notifications<br/>[notify.py]"]
end

node_user(("User"))
node_microphone(("Microphone"))
node_web(("Web browser"))
node_weather_provider(("Weather provider"))
node_ai_provider(("AI API"))
node_audio(("Audio output"))
node_desktop_notifications(("Desktop notifications"))

node_user -->|"controls"| node_main_gui
node_main_gui -->|"starts or stops"| node_engine
node_main_gui -->|"opens settings"| node_settings_gui
node_settings_gui -->|"uses widgets"| node_gui_elements
node_settings_gui -->|"opens help"| node_help_window
node_settings_gui -->|"saves settings"| node_data
node_engine -->|"captures commands"| node_listener
node_microphone -.->|"provides audio"| node_listener
node_engine -->|"dispatches commands"| node_commands
node_engine -->|"speaks activation"| node_speech
node_engine -->|"notifies lifecycle"| node_notify
node_engine -->|"reads timeout"| node_data
node_commands -->|"routes browser commands"| node_browser
node_commands -->|"routes weather commands"| node_weather_cmd
node_commands -->|"requests responses"| node_ai
node_commands -->|"speaks AI response"| node_speech
node_browser -->|"reads bookmarks"| node_data
node_browser -->|"speaks actions"| node_speech
node_browser -->|"opens pages or media"| node_web
node_weather_cmd -->|"requests forecast"| node_weather
node_weather_cmd -->|"reads location"| node_data
node_weather_cmd -->|"speaks forecast"| node_speech
node_weather -.->|"retrieves forecast"| node_weather_provider
node_ai -->|"reads AI settings"| node_data
node_ai -->|"sends prompt"| node_ai_provider
node_speech -->|"reads voice setting"| node_data
node_speech -->|"plays generated speech"| node_audio
node_notify -->|"reads assistant name"| node_data
node_notify -->|"shows alerts"| node_desktop_notifications

click node_main_gui "https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/gui/main_interface.py"
click node_settings_gui "https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/gui/settings_interface.py"
click node_gui_elements "https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/gui/gui_elements.py"
click node_help_window "https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/gui/help_window.py"
click node_engine "https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/engine.py"
click node_listener "https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/voice/listener.py"
click node_commands "https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/commands/core.py"
click node_speech "https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/voice/speech.py"
click node_browser "https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/commands/browser_cmd.py"
click node_weather_cmd "https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/commands/weather_cmd.py"
click node_weather "https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/services/weather.py"
click node_ai "https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/services/ai_service.py"
click node_data "https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/data_handler/data_handling.py"
click node_notify "https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/notify.py"

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_gui,node_settings_gui,node_gui_elements,node_help_window,node_user,node_web toneBlue
class node_engine,node_listener,node_commands,node_speech toneAmber
class node_browser,node_weather_cmd,node_weather,node_ai,node_ai_provider toneMint
class node_data,node_notify toneRose
class node_microphone,node_weather_provider,node_audio,node_desktop_notifications toneIndigo
```

## Components

### Desktop interface

- [Main window](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/gui/main_interface.py): `gui/main_interface.py`
- [Settings window](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/gui/settings_interface.py): `gui/settings_interface.py`
- [GUI elements](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/gui/gui_elements.py): `gui/gui_elements.py`
- [Help popup](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/gui/help_window.py): `gui/help_window.py`

### Assistant runtime

- [Assistant engine](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/engine.py): `modules/engine.py`
- [Voice listener](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/voice/listener.py): `modules/voice/listener.py`
- [Command dispatcher](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/commands/core.py): `modules/commands/core.py`
- [Speech output](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/voice/speech.py): `modules/voice/speech.py`

### Command capabilities

- [Browser and media](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/commands/browser_cmd.py): `modules/commands/browser_cmd.py`
- [Weather commands](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/commands/weather_cmd.py): `modules/commands/weather_cmd.py`
- [Forecast service](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/services/weather.py): `modules/services/weather.py`
- [AI responses](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/services/ai_service.py): `modules/services/ai_service.py`

### Shared services

- [Settings and bookmarks](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/data_handler/data_handling.py): `modules/data_handler/data_handling.py`
- [Notifications](https://github.com/ankush-naskar/jarvis-voice-assistant/blob/main/modules/notify.py): `modules/notify.py`

### Other components

- **User**
- **Microphone**
- **Web browser**
- **Weather provider**
- **AI API**
- **Audio output**
- **Desktop notifications**

## Connections

- User → Main window: controls (evidence: `gui/main_interface.py`)
- Main window → Assistant engine: starts or stops (evidence: `gui/main_interface.py`)
- Main window → Settings window: opens settings (evidence: `gui/main_interface.py`)
- Settings window → GUI elements: uses widgets (evidence: `gui/settings_interface.py`)
- Settings window → Help popup: opens help (evidence: `gui/settings_interface.py`)
- Settings window → Settings and bookmarks: saves settings (evidence: `gui/settings_interface.py`)
- Assistant engine → Voice listener: captures commands (evidence: `modules/engine.py`)
- Microphone → Voice listener: provides audio
- Assistant engine → Command dispatcher: dispatches commands (evidence: `modules/engine.py`)
- Assistant engine → Speech output: speaks activation (evidence: `modules/engine.py`)
- Assistant engine → Notifications: notifies lifecycle (evidence: `modules/engine.py`)
- Assistant engine → Settings and bookmarks: reads timeout (evidence: `modules/engine.py`)
- Command dispatcher → Browser and media: routes browser commands (evidence: `modules/commands/core.py`)
- Command dispatcher → Weather commands: routes weather commands (evidence: `modules/commands/core.py`)
- Command dispatcher → AI responses: requests responses (evidence: `modules/commands/core.py`)
- Command dispatcher → Speech output: speaks AI response (evidence: `modules/commands/core.py`)
- Browser and media → Settings and bookmarks: reads bookmarks (evidence: `modules/commands/browser_cmd.py`)
- Browser and media → Speech output: speaks actions (evidence: `modules/commands/browser_cmd.py`)
- Browser and media → Web browser: opens pages or media (evidence: `modules/commands/browser_cmd.py`)
- Weather commands → Forecast service: requests forecast (evidence: `modules/commands/weather_cmd.py`)
- Weather commands → Settings and bookmarks: reads location (evidence: `modules/commands/weather_cmd.py`)
- Weather commands → Speech output: speaks forecast (evidence: `modules/commands/weather_cmd.py`)
- Forecast service → Weather provider: retrieves forecast
- AI responses → Settings and bookmarks: reads AI settings (evidence: `modules/services/ai_service.py`)
- AI responses → AI API: sends prompt (evidence: `modules/services/ai_service.py`)
- Speech output → Settings and bookmarks: reads voice setting (evidence: `modules/voice/speech.py`)
- Speech output → Audio output: plays generated speech (evidence: `modules/voice/speech.py`)
- Notifications → Settings and bookmarks: reads assistant name (evidence: `modules/notify.py`)
- Notifications → Desktop notifications: shows alerts (evidence: `modules/notify.py`)
