# nikhiltiwari1234/live-ai-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/nikhiltiwari1234/live-ai-assistant
- Repository: https://github.com/nikhiltiwari1234/live-ai-assistant

## Overview

This small Python script repeatedly captures the screen, converts it to PNG bytes, and sends changed screenshots to Gemini for application/activity/error analysis. It prints the response and uses the prior screenshot and response to avoid unchanged-image requests and ask Gemini to suppress similar answers. The sampled source shows this workflow in one file; it does not show user-facing support actions beyond printed advice.

Main entry points: [`live_assistant.py`](https://github.com/nikhiltiwari1234/live-ai-assistant/blob/main/live_assistant.py) (Monitoring loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_desktop(("Desktop"))
node_monitor["Monitoring loop<br/>[live_assistant.py]"]
node_capture["Screen capture<br/>[live_assistant.py]"]
node_image["PNG change check<br/>[live_assistant.py]"]
node_gemini{{"Gemini API"}}
node_console["Console output"]

node_monitor -->|"captures"| node_capture
node_capture -->|"reads screen"| node_desktop
node_monitor -->|"checks changes"| node_image
node_monitor -->|"submits image"| node_gemini
node_gemini -->|"returns analysis"| node_monitor
node_monitor -->|"prints response"| node_console

click node_monitor "https://github.com/nikhiltiwari1234/live-ai-assistant/blob/main/live_assistant.py"
click node_capture "https://github.com/nikhiltiwari1234/live-ai-assistant/blob/main/live_assistant.py"
click node_image "https://github.com/nikhiltiwari1234/live-ai-assistant/blob/main/live_assistant.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_desktop,node_console toneIndigo
class node_monitor,node_image toneTeal
class node_capture toneBlue
class node_gemini toneMint
```

## Components

### Other components

- **Desktop**
- [Monitoring loop](https://github.com/nikhiltiwari1234/live-ai-assistant/blob/main/live_assistant.py): `live_assistant.py`
- [Screen capture](https://github.com/nikhiltiwari1234/live-ai-assistant/blob/main/live_assistant.py): `live_assistant.py`
- [PNG change check](https://github.com/nikhiltiwari1234/live-ai-assistant/blob/main/live_assistant.py): `live_assistant.py`
- **Gemini API**
- **Console output**

## Connections

- Monitoring loop → Screen capture: captures (evidence: `live_assistant.py`)
- Screen capture → Desktop: reads screen (evidence: `live_assistant.py`)
- Monitoring loop → PNG change check: checks changes (evidence: `live_assistant.py`)
- Monitoring loop → Gemini API: submits image (evidence: `live_assistant.py`)
- Gemini API → Monitoring loop: returns analysis (evidence: `live_assistant.py`)
- Monitoring loop → Console output: prints response (evidence: `live_assistant.py`)
