# omkara-bajpai/ai-chat architecture

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

- Interactive diagram: https://gitdiagram.com/omkara-bajpai/ai-chat
- Repository: https://github.com/omkara-bajpai/ai-chat

## Overview

This is a small, single-file Windows voice assistant. Its loop greets the user, listens for a command prefixed with “Jarvis,” dispatches supported actions, and speaks responses. The main capabilities are opening websites or desktop applications, querying Wikipedia, telling the time, and fetching weather for a configured city. All implementation nodes point to main.py; the edges reflect calls and integrations visible in that excerpt.

Main entry points: [`main.py`](https://github.com/omkara-bajpai/ai-chat/blob/main/main.py) (Command dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Voice interaction"]
  node_assistant["Assistant loop<br/>[main.py]"]
  node_listener["Command listener<br/>[main.py]"]
  node_speech_output["Speech output<br/>[main.py]"]
end

subgraph group_commands["Command actions"]
  node_router["Command dispatch<br/>[main.py]"]
  node_site_launcher["Website launcher<br/>[main.py]"]
  node_app_launcher["App launcher<br/>[main.py]"]
  node_wiki_lookup["Wikipedia lookup<br/>[main.py]"]
  node_time_report["Time report<br/>[main.py]"]
  node_weather_lookup["Weather lookup<br/>[main.py]"]
end

subgraph group_integrations["External services"]
  node_microphone(("Microphone"))
  node_speech_recognition["Speech recognition"]
  node_voice["Windows voice"]
  node_browser["System browser"]
  node_operating_system["Desktop applications"]
  node_wikipedia_service["Wikipedia service"]
  node_clock["System clock"]
  node_weather_service["Weather API"]
end

node_user(("User"))

node_user -->|"issues commands"| node_assistant
node_assistant -->|"listens via"| node_listener
node_listener -->|"captures audio"| node_microphone
node_listener -->|"transcribes audio"| node_speech_recognition
node_assistant -->|"greets through"| node_speech_output
node_speech_output -->|"speaks via"| node_voice
node_assistant -->|"dispatches command"| node_router
node_router -->|"routes website request"| node_site_launcher
node_site_launcher -->|"opens site"| node_browser
node_router -->|"routes app request"| node_app_launcher
node_app_launcher -->|"launches application"| node_operating_system
node_router -->|"routes search"| node_wiki_lookup
node_wiki_lookup -->|"requests summary"| node_wikipedia_service
node_wiki_lookup -->|"speaks result"| node_speech_output
node_router -->|"routes time request"| node_time_report
node_time_report -->|"reads current time"| node_clock
node_time_report -->|"speaks time"| node_speech_output
node_router -->|"routes weather request"| node_weather_lookup
node_weather_lookup -->|"requests conditions"| node_weather_service
node_weather_lookup -->|"speaks temperature"| node_speech_output

click node_assistant "https://github.com/omkara-bajpai/ai-chat/blob/main/main.py"
click node_listener "https://github.com/omkara-bajpai/ai-chat/blob/main/main.py"
click node_speech_output "https://github.com/omkara-bajpai/ai-chat/blob/main/main.py"
click node_router "https://github.com/omkara-bajpai/ai-chat/blob/main/main.py"
click node_site_launcher "https://github.com/omkara-bajpai/ai-chat/blob/main/main.py"
click node_app_launcher "https://github.com/omkara-bajpai/ai-chat/blob/main/main.py"
click node_wiki_lookup "https://github.com/omkara-bajpai/ai-chat/blob/main/main.py"
click node_time_report "https://github.com/omkara-bajpai/ai-chat/blob/main/main.py"
click node_weather_lookup "https://github.com/omkara-bajpai/ai-chat/blob/main/main.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_assistant,node_listener,node_speech_output,node_user toneBlue
class node_router,node_site_launcher,node_app_launcher,node_wiki_lookup,node_time_report,node_weather_lookup toneAmber
class node_microphone,node_speech_recognition,node_voice,node_browser,node_operating_system,node_wikipedia_service,node_clock,node_weather_service toneMint
```

## Components

### Voice interaction

- [Assistant loop](https://github.com/omkara-bajpai/ai-chat/blob/main/main.py): `main.py`
- [Command listener](https://github.com/omkara-bajpai/ai-chat/blob/main/main.py): `main.py`
- [Speech output](https://github.com/omkara-bajpai/ai-chat/blob/main/main.py): `main.py`

### Command actions

- [Command dispatch](https://github.com/omkara-bajpai/ai-chat/blob/main/main.py): `main.py`
- [Website launcher](https://github.com/omkara-bajpai/ai-chat/blob/main/main.py): `main.py`
- [App launcher](https://github.com/omkara-bajpai/ai-chat/blob/main/main.py): `main.py`
- [Wikipedia lookup](https://github.com/omkara-bajpai/ai-chat/blob/main/main.py): `main.py`
- [Time report](https://github.com/omkara-bajpai/ai-chat/blob/main/main.py): `main.py`
- [Weather lookup](https://github.com/omkara-bajpai/ai-chat/blob/main/main.py): `main.py`

### External services

- **Microphone**
- **Speech recognition**
- **Windows voice**
- **System browser**
- **Desktop applications**
- **Wikipedia service**
- **System clock**
- **Weather API**

### Other components

- **User**

## Connections

- User → Assistant loop: issues commands (evidence: `main.py`)
- Assistant loop → Command listener: listens via (evidence: `main.py`)
- Command listener → Microphone: captures audio (evidence: `main.py`)
- Command listener → Speech recognition: transcribes audio (evidence: `main.py`)
- Assistant loop → Speech output: greets through (evidence: `main.py`)
- Speech output → Windows voice: speaks via (evidence: `main.py`)
- Assistant loop → Command dispatch: dispatches command (evidence: `main.py`)
- Command dispatch → Website launcher: routes website request (evidence: `main.py`)
- Website launcher → System browser: opens site (evidence: `main.py`)
- Command dispatch → App launcher: routes app request (evidence: `main.py`)
- App launcher → Desktop applications: launches application (evidence: `main.py`)
- Command dispatch → Wikipedia lookup: routes search (evidence: `main.py`)
- Wikipedia lookup → Wikipedia service: requests summary (evidence: `main.py`)
- Wikipedia lookup → Speech output: speaks result (evidence: `main.py`)
- Command dispatch → Time report: routes time request (evidence: `main.py`)
- Time report → System clock: reads current time (evidence: `main.py`)
- Time report → Speech output: speaks time (evidence: `main.py`)
- Command dispatch → Weather lookup: routes weather request (evidence: `main.py`)
- Weather lookup → Weather API: requests conditions (evidence: `main.py`)
- Weather lookup → Speech output: speaks temperature (evidence: `main.py`)
