# pyro-warrior-1884/personal_laptop_ai_assistant architecture

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

- Interactive diagram: https://gitdiagram.com/pyro-warrior-1884/personal_laptop_ai_assistant
- Repository: https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant

## Overview

##### Project type and purpose
- This is a full-stack, cross-platform AI assistant for your laptop. It consists of a Python “orchestrator” (BMO.py) that ties together speech-to-text, local LLM inference, text-to-speech, and browser automation, plus a React/TypeScript frontend in the `bmo/` folder for visual/textual interaction.

##### File structure
Top-level
- BMO.py – Main Python controller for voice I/O, LLM calls, TTS, and Chrome integration
- README.md – High-level project description (local LLM, Vosk, ElevenLabs, Chrome, cross-platform)
bmo/ (frontend)
- package.json, tsconfig.json – React/TypeScript build config
- public/ – Static assets for the UI
- src/ – JSX/TSX source, with entry-client.tsx & entry-server.tsx, components (Counter), and route files for Remix or similar SSR/CSR routing

##### README for additional insights
- Uses Ollama to host a local LLM (gemma:2b)
- Vosk for offline speech recognition
- ElevenLabs API for TTS
- Chrome access (for web automation or browsing)

## Diagram (Mermaid)

```mermaid
graph TD
    %% Entities
    User["User"]:::external

    subgraph "Frontend (React App)"
        UI["Browser / React UI"]:::frontend
        srcDir["bmo/src"]:::frontend
        entryClient["entry-client.tsx"]:::frontend
        entryServer["entry-server.tsx"]:::frontend
        CounterComp["Counter.tsx"]:::frontend
        CounterCSS["Counter.css"]:::frontend
        RouteHome["routes/index.tsx"]:::frontend
        RouteAbout["routes/about.tsx"]:::frontend
        Route404["routes/[...404].tsx"]:::frontend
        tsconfig["tsconfig.json"]:::frontend
        pkg["package.json"]:::frontend
        lock["package-lock.json"]:::frontend
        appConfig["app.config.ts"]:::frontend
        public["public/"]:::frontend
        globalTypes["global.d.ts"]:::frontend
        readmeFE["README.md"]:::frontend
    end

    subgraph "Backend Orchestrator"
        BMO["BMO.py"]:::backend
    end

    subgraph "Local Services"
        Vosk["STT Engine\n(Vosk)"]:::service
        Ollama["LLM Service\n(Ollama)"]:::service
    end

    subgraph "External APIs"
        Eleven["TTS API\n(ElevenLabs)"]:::external
    end

    Browser["Chrome Automation"]:::service
    OSAudio["OS Audio I/O & Mic"]:::service
    readmeProj["README.md"]:::external

    %% Data Flows
    User -->|Interacts| UI
    UI -->|"HTTP/WebSocket"| BMO
    BMO -->|"stream audio"| Vosk
    Vosk -->|"transcript"| BMO
    BMO -->|"prompt text"| Ollama
    Ollama -->|"response text"| BMO
    BMO -->|"text to synthesize"| Eleven
    Eleven -->|"audio stream"| BMO
    BMO -->|"play audio"| OSAudio
    BMO -->|"control actions"| Browser
    BMO -->|"status & response"| UI

    %% Click Events
    click UI "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/tree/main/bmo/src"
    click entryClient "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/blob/main/bmo/src/entry-client.tsx"
    click entryServer "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/blob/main/bmo/src/entry-server.tsx"
    click CounterComp "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/blob/main/bmo/src/components/Counter.tsx"
    click CounterCSS "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/blob/main/bmo/src/components/Counter.css"
    click RouteHome "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/blob/main/bmo/src/routes/index.tsx"
    click RouteAbout "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/blob/main/bmo/src/routes/about.tsx"
    click Route404 "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/blob/main/bmo/src/routes/[...404].tsx"
    click tsconfig "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/blob/main/bmo/tsconfig.json"
    click pkg "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/blob/main/bmo/package.json"
    click lock "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/blob/main/bmo/package-lock.json"
    click appConfig "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/blob/main/bmo/app.config.ts"
    click public "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/tree/main/bmo/public"
    click globalTypes "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/blob/main/bmo/src/global.d.ts"
    click readmeFE "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/blob/main/bmo/README.md"
    click BMO "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/blob/main/BMO.py"
    click readmeProj "https://github.com/pyro-warrior-1884/personal_laptop_ai_assistant/blob/main/README.md"

    %% Styles
    classDef frontend fill:#D6EAF8,stroke:#1B4F72,color:#1B2631;
    classDef backend fill:#AED6F1,stroke:#154360,color:#1B2631;
    classDef service fill:#A9DFBF,stroke:#196F3D,color:#1B2631;
    classDef external fill:#F9E79F,stroke:#7D6608,color:#1B2631;
```
