# raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing architecture

> Architecture diagram of the GitHub repository raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing
- Repository: https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing

## Overview

This is a modular desktop voice/text assistant. The principal flow is user input through the assistant loop, optional speech recognition, confidence-gated intent classification, command routing to local tools or memory, and spoken response. A separate training stage prepares the classifier artifacts. The README documents confirmation and a future LLM hook, but the sampled router does not show confirmation logic; those capabilities are therefore not represented as active runtime paths. Edges are limited to sampled calls and documented relationships.

Main entry points: [`core/assistant.py`](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/core/assistant.py) (Assistant loop), [`core/router.py`](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/core/router.py) (Command router), [`nlp/train.py`](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/nlp/train.py) (Model training), [`main.py`](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/main.py) (Application entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Assistant interaction"]
  node_entry["Application entry<br/>[main.py]"]
  node_assistant["Assistant loop<br/>[assistant.py]"]
  node_speech["Speech input<br/>[speech.py]"]
  node_tts["Speech output<br/>[tts.py]"]
end

subgraph group_understanding["Intent understanding"]
  node_classifier["Intent classifier<br/>[classifier.py]"]
  node_training["Model training<br/>[train.py]"]
  node_intent_data["Intent examples<br/>[intents.json]"]
  node_model_artifacts[("Model artifacts")]
end

subgraph group_actions["Command capabilities"]
  node_router["Command router<br/>[router.py]"]
  node_browser["Web actions<br/>[browser.py]"]
  node_applications["Desktop apps<br/>[applications.py]"]
  node_system["System controls<br/>[system.py]"]
end

subgraph group_operations["State and operations"]
  node_memory[("Assistant memory<br/>[memory.py]")]
  node_logger["Structured logging<br/>[logger.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
end

node_user(("User"))

node_user -->|"starts"| node_entry
node_entry -->|"launches"| node_assistant
node_user -->|"provides text"| node_assistant
node_assistant -->|"captures voice"| node_speech
node_assistant -->|"classifies text"| node_classifier
node_classifier -.->|"loads model"| node_model_artifacts
node_training -.->|"trains from"| node_intent_data
node_training -.->|"creates"| node_model_artifacts
node_assistant -->|"dispatches intent"| node_router
node_router -->|"calls"| node_browser
node_router -->|"calls"| node_applications
node_router -->|"calls"| node_system
node_router -->|"reads and writes"| node_memory
node_assistant -->|"speaks response"| node_tts
node_assistant -->|"logs events"| node_logger
node_assistant -->|"loads settings"| node_config

click node_entry "https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/main.py"
click node_assistant "https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/core/assistant.py"
click node_speech "https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/core/speech.py"
click node_tts "https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/core/tts.py"
click node_classifier "https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/core/classifier.py"
click node_training "https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/nlp/train.py"
click node_intent_data "https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/intents.json"
click node_model_artifacts "https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/tree/main/models"
click node_router "https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/core/router.py"
click node_browser "https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/tools/browser.py"
click node_applications "https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/tools/applications.py"
click node_system "https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/tools/system.py"
click node_memory "https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/tools/memory.py"
click node_logger "https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/core/logger.py"
click node_config "https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/config.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_entry,node_assistant,node_speech,node_tts,node_user toneBlue
class node_classifier,node_training,node_intent_data,node_model_artifacts toneAmber
class node_router,node_browser,node_applications,node_system toneMint
class node_memory,node_logger,node_config toneRose
```

## Components

### Assistant interaction

- [Application entry](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/main.py): `main.py`
- [Assistant loop](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/core/assistant.py): `core/assistant.py`
- [Speech input](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/core/speech.py): `core/speech.py`
- [Speech output](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/core/tts.py): `core/tts.py`

### Intent understanding

- [Intent classifier](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/core/classifier.py): `core/classifier.py`
- [Model training](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/nlp/train.py): `nlp/train.py`
- [Intent examples](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/intents.json): `intents.json`
- [Model artifacts](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/tree/main/models): `models`

### Command capabilities

- [Command router](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/core/router.py): `core/router.py`
- [Web actions](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/tools/browser.py): `tools/browser.py`
- [Desktop apps](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/tools/applications.py): `tools/applications.py`
- [System controls](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/tools/system.py): `tools/system.py`

### State and operations

- [Assistant memory](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/tools/memory.py): `tools/memory.py`
- [Structured logging](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/core/logger.py): `core/logger.py`
- [Runtime configuration](https://github.com/raushanraj435/desktop-based-virtual-assistant-using-python-based-on-natural-language-processing/blob/main/config.py): `config.py`

### Other components

- **User**

## Connections

- User → Application entry: starts (evidence: `README.md`)
- Application entry → Assistant loop: launches (evidence: `main.py`)
- User → Assistant loop: provides text (evidence: `core/assistant.py`)
- Assistant loop → Speech input: captures voice (evidence: `core/assistant.py`)
- Assistant loop → Intent classifier: classifies text (evidence: `core/assistant.py`)
- Intent classifier → Model artifacts: loads model (evidence: `README.md`)
- Model training → Intent examples: trains from (evidence: `README.md`)
- Model training → Model artifacts: creates (evidence: `README.md`)
- Assistant loop → Command router: dispatches intent (evidence: `core/assistant.py`)
- Command router → Web actions: calls (evidence: `core/router.py`)
- Command router → Desktop apps: calls (evidence: `core/router.py`)
- Command router → System controls: calls (evidence: `core/router.py`)
- Command router → Assistant memory: reads and writes (evidence: `core/router.py`)
- Assistant loop → Speech output: speaks response (evidence: `core/assistant.py`)
- Assistant loop → Structured logging: logs events (evidence: `core/assistant.py`)
- Assistant loop → Runtime configuration: loads settings (evidence: `core/assistant.py`)
