# vibhasdutta/pc-assistant architecture

> Architecture diagram of the GitHub repository vibhasdutta/pc-assistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vibhasdutta/pc-assistant
- Repository: https://github.com/vibhasdutta/pc-assistant

## Overview

##### Main Components

a) Core System Components:
- Core Engine (Core_main.py)
- Rule-Based AI Decision System
- Speech Recognition & Text-to-Speech Interface
- Task Scheduler

b) Feature Modules:
- Communication Services (Gmail, WhatsApp)
- Calendar Management
- Weather Service
- Web Automation
- Gemini LLM Integration
- Search Functionality

c) Data Storage:
- City Database
- Response Data Storage
- Credentials Management

**┌─ User Interface Layer ─────────────────────┐**
- Speech Recognition                       │
- Text-to-Speech                          │
- Command Processing                       │
- ┬───────────────────────┘
- ↓
**┌─ Core Processing Layer ───────────────────┐**
- Rule-Based AI Engine                    │
- Task Management                         │
- Command Router                          │
- ┬───────────────────────┘
- ↓
**┌─ Feature Services Layer ──────────────────┐**
- ┌─────────┐ ┌─────────┐ ┌──────────────┐ │
- Gmail   │ │ Weather │ │ WhatsApp     │ │
- ┘ └─────────┘ └──────────────┘ │
- ┌─────────┐ ┌─────────┐ ┌──────────────┐ │
- Calendar │ │ Search  │ │ Web Auto     │ │
- ┘ └─────────┘ └──────────────┘ │
- ┬───────────────────────┘
- ↓
**┌─ External Services Layer ─────────────────┐**
- Gemini API                             │
- Weather API                            │
- Google APIs (Gmail, Calendar)          │
- ┘

##### Important Elements to Highlight

- User input → Speech Recognition → Core Engine
- Core Engine → Feature Services
- Feature Services → External APIs
- Response flow back to user

b) Integration Points:
- API connections (Gemini, Weather, Google Services)
- Database interactions
- File system operations

##### Additional Notes

- Version compatibility (Windows 10+, Python 3.11.6)
- API key requirements
- Resource requirements (8GB RAM minimum)
- Extensibility points for custom features

- Rule-based approach implementation
- Threading model for parallel processing
- API integration strategy
- Security considerations for credential management

This will help other developers understand both the current architecture and how to extend it in the future.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI["User Interface Layer"]
        SR[Speech Recognition]
        TTS[Text-to-Speech]
        CP[Command Processing]
    end

    subgraph Core["Core Processing Layer"]
        CE["Core Engine"]:::core
        TS["Task Scheduler"]:::core
        CR[Command Router]
        RB[Rule-Based AI Engine]
    end

    subgraph Features["Feature Services Layer"]
        GS["Gmail Service"]:::feature
        WA["WhatsApp Integration"]:::feature
        CM["Calendar Management"]:::feature
        WS["Weather Service"]:::feature
        WEB["Web Automation"]:::feature
        GEM["Gemini LLM"]:::feature
        SF["Search Function"]:::feature
    end

    subgraph Data["Data Storage Layer"]
        CD["City Database"]:::storage
        RD["Response Data"]:::storage
        WD["Web Database"]:::storage
        CRED["Credentials"]:::storage
    end

    subgraph External["External Services Layer"]
        GAPI[Google APIs]:::external
        WAPI[Weather API]:::external
        GEMAPI[Gemini API]:::external
    end

    %% Connections
    SR --> CP
    CP --> CE
    CE --> CR
    CR --> TS
    CR --> RB

    RB --> GS
    RB --> WA
    RB --> CM
    RB --> WS
    RB --> WEB
    RB --> GEM
    RB --> SF

    GS --> GAPI
    CM --> GAPI
    WS --> WAPI
    GEM --> GEMAPI

    WS --> CD
    WEB --> WD
    GS --> CRED
    CM --> CRED

    %% Return Flow
    GS --> TTS
    WA --> TTS
    CM --> TTS
    WS --> TTS
    WEB --> TTS
    GEM --> TTS
    SF --> TTS

    %% Styling
    classDef core fill:#a2d2ff
    classDef feature fill:#bde0fe
    classDef storage fill:#ffafcc
    classDef external fill:#ffc8dd
    classDef ui fill:#cdb4db

    %% Click Events
    click CE "https://github.com/vibhasdutta/PC-ASSISTANT/blob/main/Core_main.py"
    click TS "https://github.com/vibhasdutta/PC-ASSISTANT/blob/main/Task.py"
    click GS "https://github.com/vibhasdutta/PC-ASSISTANT/blob/main/Gmail_feature.py"
    click WA "https://github.com/vibhasdutta/PC-ASSISTANT/blob/main/whatsapp_automate_feature.py"
    click CM "https://github.com/vibhasdutta/PC-ASSISTANT/blob/main/calendar_event_feature.py"
    click WS "https://github.com/vibhasdutta/PC-ASSISTANT/blob/main/weather_feature_and_location.py"
    click WEB "https://github.com/vibhasdutta/PC-ASSISTANT/blob/main/Windows_automation.py"
    click GEM "https://github.com/vibhasdutta/PC-ASSISTANT/blob/main/gemini_LLM.py"
    click SF "https://github.com/vibhasdutta/PC-ASSISTANT/blob/main/search_function.py"
    click CD "https://github.com/vibhasdutta/PC-ASSISTANT/blob/main/city_name_database.py"
    click RD "https://github.com/vibhasdutta/PC-ASSISTANT/blob/main/respones_data.py"
    click WD "https://github.com/vibhasdutta/PC-ASSISTANT/blob/main/WebDatabase.py"
    click CRED "https://github.com/vibhasdutta/PC-ASSISTANT/blob/main/credentials.json"
```
