# leandros04/jarvis architecture

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

- Interactive diagram: https://gitdiagram.com/leandros04/jarvis
- Repository: https://github.com/leandros04/jarvis

## Overview

JARVIS is a local-first Windows voice assistant. Its principal workflow listens for a wake word, transcribes speech locally, handles fast commands or routes reasoning to a model, dispatches selected tools, and speaks a response. The tool surface includes desktop and file control, browser automation, memory, scheduling, remote SSH/SCP, and reusable routines; health monitoring and cost accounting are supporting capabilities. Edges use README workflow documentation and the shown broker/source references; unsampled implementation details are not asserted.

Main entry points: [`jarvis.py`](https://github.com/leandros04/jarvis/blob/main/jarvis.py) (Assistant broker), [`voice_tools.py`](https://github.com/leandros04/jarvis/blob/main/voice_tools.py) (Speech input/output), [`ai_router.py`](https://github.com/leandros04/jarvis/blob/main/ai_router.py) (Model routing), [`wakeword_tools.py`](https://github.com/leandros04/jarvis/blob/main/wakeword_tools.py) (Wake detection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Voice interaction"]
  node_wake["Wake detection<br/>[wakeword_tools.py]"]
  node_speech["Speech input/output<br/>[voice_tools.py]"]
end

subgraph group_orchestration["Assistant orchestration"]
  node_broker["Assistant broker<br/>[jarvis.py]"]
  node_router["Model routing<br/>[ai_router.py]"]
  node_cost["API cost tracking<br/>[cost_tracker.py]"]
end

subgraph group_computer["Computer tools"]
  node_system["Windows and files<br/>[system_tools.py]"]
  node_desktop["Desktop controls<br/>[desktop_tools.py]"]
  node_admin["Admin and processes<br/>[admin_tools.py]"]
  node_browser["Browser automation<br/>[browser_tools.py]"]
end

subgraph group_services["Memory and integrations"]
  node_memory[("Persistent memory<br/>[memory_tools.py]")]
  node_scheduler[("Timers and reminders<br/>[scheduler_tools.py]")]
  node_remote[("Remote SSH and SCP<br/>[remote_tools.py]")]
  node_routines[("Named routines<br/>[routine_tools.py]")]
end

subgraph group_operations["Operations"]
  node_health["Health monitoring<br/>[health_tools.py]"]
  node_tray["System tray launcher<br/>[tray_app.py]"]
end

node_user(("User"))
node_openai{{"OpenAI API"}}
node_ollama{{"Ollama router"}}

node_user -->|"says wake word"| node_wake
node_wake -->|"starts listening"| node_speech
node_speech -->|"transcribes request"| node_broker
node_broker -->|"routes reasoning"| node_router
node_router -.->|"classifies optionally"| node_ollama
node_router -->|"selects model"| node_openai
node_broker -->|"requests reasoning"| node_openai
node_broker -->|"dispatches tools"| node_system
node_broker -->|"dispatches tools"| node_desktop
node_broker -->|"dispatches tools"| node_admin
node_broker -->|"dispatches tools"| node_browser
node_broker -->|"dispatches tools"| node_memory
node_broker -->|"dispatches tools"| node_scheduler
node_broker -->|"dispatches tools"| node_remote
node_broker -->|"dispatches tools"| node_routines
node_broker -->|"accounts usage"| node_cost
node_broker -->|"dispatches checks"| node_health
node_speech -->|"speaks response"| node_user
node_scheduler -->|"shows notifications"| node_desktop
node_tray -->|"starts process"| node_broker

click node_wake "https://github.com/leandros04/jarvis/blob/main/wakeword_tools.py"
click node_speech "https://github.com/leandros04/jarvis/blob/main/voice_tools.py"
click node_broker "https://github.com/leandros04/jarvis/blob/main/jarvis.py"
click node_router "https://github.com/leandros04/jarvis/blob/main/ai_router.py"
click node_cost "https://github.com/leandros04/jarvis/blob/main/cost_tracker.py"
click node_system "https://github.com/leandros04/jarvis/blob/main/system_tools.py"
click node_desktop "https://github.com/leandros04/jarvis/blob/main/desktop_tools.py"
click node_admin "https://github.com/leandros04/jarvis/blob/main/admin_tools.py"
click node_browser "https://github.com/leandros04/jarvis/blob/main/browser_tools.py"
click node_memory "https://github.com/leandros04/jarvis/blob/main/memory_tools.py"
click node_scheduler "https://github.com/leandros04/jarvis/blob/main/scheduler_tools.py"
click node_remote "https://github.com/leandros04/jarvis/blob/main/remote_tools.py"
click node_routines "https://github.com/leandros04/jarvis/blob/main/routine_tools.py"
click node_health "https://github.com/leandros04/jarvis/blob/main/health_tools.py"
click node_tray "https://github.com/leandros04/jarvis/blob/main/tray_app.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_wake,node_speech,node_user toneBlue
class node_broker,node_router,node_cost toneAmber
class node_system,node_desktop,node_admin,node_browser,node_openai,node_ollama toneMint
class node_memory,node_scheduler,node_remote,node_routines toneRose
class node_health,node_tray toneIndigo
```

## Components

### Voice interaction

- [Wake detection](https://github.com/leandros04/jarvis/blob/main/wakeword_tools.py): `wakeword_tools.py`
- [Speech input/output](https://github.com/leandros04/jarvis/blob/main/voice_tools.py): `voice_tools.py`

### Assistant orchestration

- [Assistant broker](https://github.com/leandros04/jarvis/blob/main/jarvis.py): `jarvis.py`
- [Model routing](https://github.com/leandros04/jarvis/blob/main/ai_router.py): `ai_router.py`
- [API cost tracking](https://github.com/leandros04/jarvis/blob/main/cost_tracker.py): `cost_tracker.py`

### Computer tools

- [Windows and files](https://github.com/leandros04/jarvis/blob/main/system_tools.py): `system_tools.py`
- [Desktop controls](https://github.com/leandros04/jarvis/blob/main/desktop_tools.py): `desktop_tools.py`
- [Admin and processes](https://github.com/leandros04/jarvis/blob/main/admin_tools.py): `admin_tools.py`
- [Browser automation](https://github.com/leandros04/jarvis/blob/main/browser_tools.py): `browser_tools.py`

### Memory and integrations

- [Persistent memory](https://github.com/leandros04/jarvis/blob/main/memory_tools.py): `memory_tools.py`
- [Timers and reminders](https://github.com/leandros04/jarvis/blob/main/scheduler_tools.py): `scheduler_tools.py`
- [Remote SSH and SCP](https://github.com/leandros04/jarvis/blob/main/remote_tools.py): `remote_tools.py`
- [Named routines](https://github.com/leandros04/jarvis/blob/main/routine_tools.py): `routine_tools.py`

### Operations

- [Health monitoring](https://github.com/leandros04/jarvis/blob/main/health_tools.py): `health_tools.py`
- [System tray launcher](https://github.com/leandros04/jarvis/blob/main/tray_app.py): `tray_app.py`

### Other components

- **User**
- **OpenAI API**
- **Ollama router**

## Connections

- User → Wake detection: says wake word (evidence: `README.md`)
- Wake detection → Speech input/output: starts listening (evidence: `README.md`)
- Speech input/output → Assistant broker: transcribes request (evidence: `README.md`)
- Assistant broker → Model routing: routes reasoning (evidence: `jarvis.py`)
- Model routing → Ollama router: classifies optionally (evidence: `README.md`)
- Model routing → OpenAI API: selects model (evidence: `README.md`)
- Assistant broker → OpenAI API: requests reasoning (evidence: `README.md`)
- Assistant broker → Windows and files: dispatches tools (evidence: `jarvis.py`)
- Assistant broker → Desktop controls: dispatches tools (evidence: `jarvis.py`)
- Assistant broker → Admin and processes: dispatches tools (evidence: `jarvis.py`)
- Assistant broker → Browser automation: dispatches tools (evidence: `jarvis.py`)
- Assistant broker → Persistent memory: dispatches tools (evidence: `jarvis.py`)
- Assistant broker → Timers and reminders: dispatches tools (evidence: `jarvis.py`)
- Assistant broker → Remote SSH and SCP: dispatches tools (evidence: `jarvis.py`)
- Assistant broker → Named routines: dispatches tools (evidence: `jarvis.py`)
- Assistant broker → API cost tracking: accounts usage (evidence: `jarvis.py`)
- Assistant broker → Health monitoring: dispatches checks (evidence: `jarvis.py`)
- Speech input/output → User: speaks response (evidence: `README.md`)
- Timers and reminders → Desktop controls: shows notifications (evidence: `scheduler_tools.py`)
- System tray launcher → Assistant broker: starts process (evidence: `tray_app.py`)
