# mahitech580/jarvis-ai architecture

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

- Interactive diagram: https://gitdiagram.com/mahitech580/jarvis-ai
- Repository: https://github.com/mahitech580/jarvis-ai

## Overview

JARVIS is a local voice assistant with a separate browser-based interface. In the desktop workflow, the user speaks, audio is transcribed, intent is detected, commands are handled locally or answered by the built-in conversational engine, the exchange is stored, and the response is spoken. The web workflow sends recognized text to Flask and uses browser speech synthesis for replies. The excerpts show the main orchestration and module calls; unsampled capabilities and configuration wiring are not expanded beyond documented behavior.

Main entry points: [`app.py`](https://github.com/mahitech580/jarvis-ai/blob/main/app.py) (Desktop assistant), [`web_server.py`](https://github.com/mahitech580/jarvis-ai/blob/main/web_server.py) (Flask API), [`web/script.js`](https://github.com/mahitech580/jarvis-ai/blob/main/web/script.js) (Browser interface), [`src/database.py`](https://github.com/mahitech580/jarvis-ai/blob/main/src/database.py) (Conversation database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_desktop["Desktop assistant<br/>[app.py]"]
  node_web_ui["Browser interface<br/>[script.js]"]
  node_web_api["Flask API<br/>[web_server.py]"]
end

subgraph group_conversation["Conversation processing"]
  node_intent["Intent detection<br/>[intent_engine.py]"]
end

subgraph group_capabilities["Assistant capabilities"]
  node_commands["Command handling<br/>[command_handler.py]"]
  node_assistant_ai["Local conversational answers<br/>[ai_engine.py]"]
end

subgraph group_state["Conversation state"]
  node_database[("Conversation database<br/>[database.py]")]
  node_sqlite[("SQLite store")]
end

subgraph group_speech["Speech I/O"]
  node_transcription["Whisper transcription<br/>[speech_to_text.py]"]
  node_speech_output["Speech output<br/>[text_to_speech.py]"]
end

node_user(("User"))
node_browser_speech["Browser speech APIs"]
node_websites["Websites and search"]

node_user -->|"speaks to"| node_desktop
node_desktop -->|"listens through"| node_transcription
node_desktop -->|"detects intent"| node_intent
node_desktop -->|"dispatches commands"| node_commands
node_desktop -->|"falls back to"| node_assistant_ai
node_desktop -->|"saves exchanges"| node_database
node_desktop -->|"loads history"| node_database
node_desktop -->|"speaks response"| node_speech_output
node_transcription -->|"captures speech"| node_user
node_speech_output -->|"plays response"| node_user
node_commands -->|"opens or searches"| node_websites
node_database -->|"reads and writes"| node_sqlite
node_user -->|"uses"| node_web_ui
node_web_ui -->|"recognizes and speaks"| node_browser_speech
node_web_ui -->|"posts command"| node_web_api
node_web_api -->|"detects intent"| node_intent
node_web_api -->|"dispatches commands"| node_commands
node_web_api -->|"falls back to"| node_assistant_ai
node_web_api -->|"saves and reads"| node_database
node_web_api -->|"serves interface"| node_web_ui

click node_desktop "https://github.com/mahitech580/jarvis-ai/blob/main/app.py"
click node_web_ui "https://github.com/mahitech580/jarvis-ai/blob/main/web/script.js"
click node_web_api "https://github.com/mahitech580/jarvis-ai/blob/main/web_server.py"
click node_intent "https://github.com/mahitech580/jarvis-ai/blob/main/src/intent_engine.py"
click node_commands "https://github.com/mahitech580/jarvis-ai/blob/main/src/command_handler.py"
click node_assistant_ai "https://github.com/mahitech580/jarvis-ai/blob/main/src/ai_engine.py"
click node_transcription "https://github.com/mahitech580/jarvis-ai/blob/main/src/speech_to_text.py"
click node_speech_output "https://github.com/mahitech580/jarvis-ai/blob/main/src/text_to_speech.py"
click node_database "https://github.com/mahitech580/jarvis-ai/blob/main/src/database.py"
click node_sqlite "https://github.com/mahitech580/jarvis-ai/tree/main/data"

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_desktop,node_web_ui,node_web_api,node_user,node_browser_speech toneBlue
class node_intent toneAmber
class node_commands,node_assistant_ai toneMint
class node_database,node_sqlite toneRose
class node_transcription,node_speech_output,node_websites toneIndigo
```

## Components

### User interfaces

- [Desktop assistant](https://github.com/mahitech580/jarvis-ai/blob/main/app.py): `app.py`
- [Browser interface](https://github.com/mahitech580/jarvis-ai/blob/main/web/script.js): `web/script.js`
- [Flask API](https://github.com/mahitech580/jarvis-ai/blob/main/web_server.py): `web_server.py`

### Conversation processing

- [Intent detection](https://github.com/mahitech580/jarvis-ai/blob/main/src/intent_engine.py): `src/intent_engine.py`

### Assistant capabilities

- [Command handling](https://github.com/mahitech580/jarvis-ai/blob/main/src/command_handler.py): `src/command_handler.py`
- [Local conversational answers](https://github.com/mahitech580/jarvis-ai/blob/main/src/ai_engine.py): `src/ai_engine.py`

### Conversation state

- [Conversation database](https://github.com/mahitech580/jarvis-ai/blob/main/src/database.py): `src/database.py`
- [SQLite store](https://github.com/mahitech580/jarvis-ai/tree/main/data): `data`

### Speech I/O

- [Whisper transcription](https://github.com/mahitech580/jarvis-ai/blob/main/src/speech_to_text.py): `src/speech_to_text.py`
- [Speech output](https://github.com/mahitech580/jarvis-ai/blob/main/src/text_to_speech.py): `src/text_to_speech.py`

### Other components

- **User**
- **Browser speech APIs**
- **Websites and search**

## Connections

- User → Desktop assistant: speaks to (evidence: `app.py`)
- Desktop assistant → Whisper transcription: listens through (evidence: `app.py`)
- Desktop assistant → Intent detection: detects intent (evidence: `app.py`)
- Desktop assistant → Command handling: dispatches commands (evidence: `app.py`)
- Desktop assistant → Local conversational answers: falls back to (evidence: `app.py`)
- Desktop assistant → Conversation database: saves exchanges (evidence: `app.py`)
- Desktop assistant → Conversation database: loads history (evidence: `app.py`)
- Desktop assistant → Speech output: speaks response (evidence: `app.py`)
- Whisper transcription → User: captures speech (evidence: `src/speech_to_text.py`)
- Speech output → User: plays response (evidence: `src/text_to_speech.py`)
- Command handling → Websites and search: opens or searches (evidence: `src/command_handler.py`)
- Conversation database → SQLite store: reads and writes (evidence: `src/database.py`)
- User → Browser interface: uses (evidence: `web/script.js`)
- Browser interface → Browser speech APIs: recognizes and speaks (evidence: `web/script.js`)
- Browser interface → Flask API: posts command (evidence: `web/script.js`)
- Flask API → Intent detection: detects intent (evidence: `web_server.py`)
- Flask API → Command handling: dispatches commands (evidence: `web_server.py`)
- Flask API → Local conversational answers: falls back to (evidence: `web_server.py`)
- Flask API → Conversation database: saves and reads (evidence: `web_server.py`)
- Flask API → Browser interface: serves interface (evidence: `web_server.py`)
