# hzaid01/jarvis architecture

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

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

## Overview

JARVIS is a Windows desktop AI assistant: the user chats or speaks through its React HUD, the AI hook selects a provider and streams a response, and parsed tool requests are dispatched through Electron for search or PC actions. Memory supplies session context; separate monitoring and voice paths provide system metrics and speech input/output. The README documents Whisper/Piper voice, search, and automation capabilities, while sampled code confirms only parts of their wiring; those links are shown only where supported. The sampled search implementation calls Tavily, despite the README naming Brave.

Main entry points: [`electron/main.js`](https://github.com/hzaid01/jarvis/blob/main/electron/main.js) (Electron main), [`src/App.jsx`](https://github.com/hzaid01/jarvis/blob/main/src/App.jsx) (HUD app), [`src/hooks/useAI.js`](https://github.com/hzaid01/jarvis/blob/main/src/hooks/useAI.js) (AI orchestration), [`electron/preload.js`](https://github.com/hzaid01/jarvis/blob/main/electron/preload.js) (IPC bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["HUD interface"]
  node_renderer["React entry<br/>[main.jsx]"]
  node_app["HUD app<br/>[App.jsx]"]
  node_chat["Chat UI<br/>[ChatCore.jsx]"]
  node_settings["Settings<br/>[Settings.jsx]"]
  node_monitorview["Stats display<br/>[SystemStats.jsx]"]
  node_memoryview["Memory panel<br/>[MemoryPanel.jsx]"]
end

subgraph group_ai["AI conversation"]
  node_aihook["AI orchestration<br/>[useAI.js]"]
  node_parser["Tool parser<br/>[toolParser.js]"]
  node_registry["Provider registry<br/>[registry.js]"]
  node_ollama["Ollama provider<br/>[ollama.js]"]
  node_cloud["Cloud providers"]
end

subgraph group_desktop["Desktop capabilities"]
  node_electron["Electron main<br/>[main.js]"]
  node_bridge["IPC bridge<br/>[preload.js]"]
  node_search["Web search<br/>[main.js]"]
  node_control["PC control<br/>[main.js]"]
end

subgraph group_memory["Persistent memory"]
  node_memorysvc["Memory service<br/>[memoryService.js]"]
  node_memorydb[("SQLite memory")]
  node_memsearch["Memory ranking<br/>[memorySearch.js]"]
end

subgraph group_voice["Voice and monitoring"]
  node_voice["Voice processing<br/>[voice_server.py]"]
  node_whisper["Whisper bridge<br/>[whisper_bridge.py]"]
  node_piper["Piper engine"]
  node_stats["Stats worker<br/>[statsWorker.js]"]
end

node_user(("User"))
node_ollamasvc["Ollama service"]
node_searchapi["Search API"]
node_hardware["System metrics"]

node_user -->|"uses"| node_renderer
node_renderer -->|"mounts"| node_app
node_app -->|"renders"| node_chat
node_app -->|"renders"| node_settings
node_app -->|"renders"| node_monitorview
node_app -->|"renders"| node_memoryview
node_chat -->|"submits messages"| node_aihook
node_settings -->|"configures provider"| node_aihook
node_aihook -->|"parses tool calls"| node_parser
node_aihook -->|"creates provider"| node_registry
node_registry -->|"selects"| node_ollama
node_registry -->|"selects"| node_cloud
node_ollama -->|"streams requests"| node_ollamasvc
node_cloud -.->|"uses configured APIs"| node_ollamasvc
node_aihook -->|"dispatches tools"| node_bridge
node_bridge -->|"forwards IPC"| node_electron
node_electron -->|"invokes"| node_search
node_electron -->|"invokes"| node_control
node_search -->|"queries"| node_searchapi
node_electron -->|"handles memory IPC"| node_memorysvc
node_memorysvc -->|"reads and writes"| node_memorydb
node_memorysvc -->|"ranks observations"| node_memsearch
node_electron -->|"starts worker"| node_stats
node_stats -->|"polls metrics"| node_hardware
node_electron -->|"sends stats and voice events"| node_bridge
node_whisper -.->|"voice processing"| node_voice
node_voice -.->|"generates speech"| node_piper
node_electron -.->|"starts voice bridge"| node_whisper
node_chat -.->|"plays generated audio"| node_voice
node_monitorview -->|"receives stats"| node_bridge
node_memoryview -->|"requests memory"| node_bridge

click node_renderer "https://github.com/hzaid01/jarvis/blob/main/src/main.jsx"
click node_app "https://github.com/hzaid01/jarvis/blob/main/src/App.jsx"
click node_chat "https://github.com/hzaid01/jarvis/blob/main/src/components/ChatCore.jsx"
click node_settings "https://github.com/hzaid01/jarvis/blob/main/src/components/Settings.jsx"
click node_monitorview "https://github.com/hzaid01/jarvis/blob/main/src/components/SystemStats.jsx"
click node_memoryview "https://github.com/hzaid01/jarvis/blob/main/src/components/MemoryPanel.jsx"
click node_aihook "https://github.com/hzaid01/jarvis/blob/main/src/hooks/useAI.js"
click node_parser "https://github.com/hzaid01/jarvis/blob/main/src/utils/toolParser.js"
click node_registry "https://github.com/hzaid01/jarvis/blob/main/src/providers/registry.js"
click node_ollama "https://github.com/hzaid01/jarvis/blob/main/src/providers/ollama.js"
click node_cloud "https://github.com/hzaid01/jarvis/tree/main/src/providers"
click node_electron "https://github.com/hzaid01/jarvis/blob/main/electron/main.js"
click node_bridge "https://github.com/hzaid01/jarvis/blob/main/electron/preload.js"
click node_search "https://github.com/hzaid01/jarvis/blob/main/electron/main.js"
click node_control "https://github.com/hzaid01/jarvis/blob/main/electron/main.js"
click node_memorysvc "https://github.com/hzaid01/jarvis/blob/main/electron/memoryService.js"
click node_memsearch "https://github.com/hzaid01/jarvis/blob/main/electron/memorySearch.js"
click node_voice "https://github.com/hzaid01/jarvis/blob/main/voice_server.py"
click node_whisper "https://github.com/hzaid01/jarvis/blob/main/whisper_bridge.py"
click node_piper "https://github.com/hzaid01/jarvis/tree/main/piper_windows_amd64/piper"
click node_stats "https://github.com/hzaid01/jarvis/blob/main/electron/workers/statsWorker.js"

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_renderer,node_app,node_chat,node_settings,node_monitorview,node_memoryview,node_user toneBlue
class node_aihook,node_parser,node_registry,node_ollama,node_cloud toneAmber
class node_electron,node_bridge,node_search,node_control,node_searchapi toneMint
class node_memorysvc,node_memorydb,node_memsearch toneRose
class node_voice,node_whisper,node_piper,node_stats,node_ollamasvc,node_hardware toneIndigo
```

## Components

### HUD interface

- [React entry](https://github.com/hzaid01/jarvis/blob/main/src/main.jsx): `src/main.jsx`
- [HUD app](https://github.com/hzaid01/jarvis/blob/main/src/App.jsx): `src/App.jsx`
- [Chat UI](https://github.com/hzaid01/jarvis/blob/main/src/components/ChatCore.jsx): `src/components/ChatCore.jsx`
- [Settings](https://github.com/hzaid01/jarvis/blob/main/src/components/Settings.jsx): `src/components/Settings.jsx`
- [Stats display](https://github.com/hzaid01/jarvis/blob/main/src/components/SystemStats.jsx): `src/components/SystemStats.jsx`
- [Memory panel](https://github.com/hzaid01/jarvis/blob/main/src/components/MemoryPanel.jsx): `src/components/MemoryPanel.jsx`

### AI conversation

- [AI orchestration](https://github.com/hzaid01/jarvis/blob/main/src/hooks/useAI.js): `src/hooks/useAI.js`
- [Tool parser](https://github.com/hzaid01/jarvis/blob/main/src/utils/toolParser.js): `src/utils/toolParser.js`
- [Provider registry](https://github.com/hzaid01/jarvis/blob/main/src/providers/registry.js): `src/providers/registry.js`
- [Ollama provider](https://github.com/hzaid01/jarvis/blob/main/src/providers/ollama.js): `src/providers/ollama.js`
- [Cloud providers](https://github.com/hzaid01/jarvis/tree/main/src/providers): `src/providers`

### Desktop capabilities

- [Electron main](https://github.com/hzaid01/jarvis/blob/main/electron/main.js): `electron/main.js`
- [IPC bridge](https://github.com/hzaid01/jarvis/blob/main/electron/preload.js): `electron/preload.js`
- [Web search](https://github.com/hzaid01/jarvis/blob/main/electron/main.js): `electron/main.js`
- [PC control](https://github.com/hzaid01/jarvis/blob/main/electron/main.js): `electron/main.js`

### Persistent memory

- [Memory service](https://github.com/hzaid01/jarvis/blob/main/electron/memoryService.js): `electron/memoryService.js`
- **SQLite memory**
- [Memory ranking](https://github.com/hzaid01/jarvis/blob/main/electron/memorySearch.js): `electron/memorySearch.js`

### Voice and monitoring

- [Voice processing](https://github.com/hzaid01/jarvis/blob/main/voice_server.py): `voice_server.py`
- [Whisper bridge](https://github.com/hzaid01/jarvis/blob/main/whisper_bridge.py): `whisper_bridge.py`
- [Piper engine](https://github.com/hzaid01/jarvis/tree/main/piper_windows_amd64/piper): `piper_windows_amd64/piper`
- [Stats worker](https://github.com/hzaid01/jarvis/blob/main/electron/workers/statsWorker.js): `electron/workers/statsWorker.js`

### Other components

- **User**
- **Ollama service**
- **Search API**
- **System metrics**

## Connections

- User → React entry: uses
- React entry → HUD app: mounts
- HUD app → Chat UI: renders
- HUD app → Settings: renders
- HUD app → Stats display: renders
- HUD app → Memory panel: renders
- Chat UI → AI orchestration: submits messages
- Settings → AI orchestration: configures provider
- AI orchestration → Tool parser: parses tool calls
- AI orchestration → Provider registry: creates provider
- Provider registry → Ollama provider: selects
- Provider registry → Cloud providers: selects
- Ollama provider → Ollama service: streams requests
- Cloud providers → Ollama service: uses configured APIs
- AI orchestration → IPC bridge: dispatches tools
- IPC bridge → Electron main: forwards IPC
- Electron main → Web search: invokes
- Electron main → PC control: invokes
- Web search → Search API: queries
- Electron main → Memory service: handles memory IPC
- Memory service → SQLite memory: reads and writes
- Memory service → Memory ranking: ranks observations
- Electron main → Stats worker: starts worker
- Stats worker → System metrics: polls metrics
- Electron main → IPC bridge: sends stats and voice events
- Whisper bridge → Voice processing: voice processing
- Voice processing → Piper engine: generates speech
- Electron main → Whisper bridge: starts voice bridge
- Chat UI → Voice processing: plays generated audio
- Stats display → IPC bridge: receives stats
- Memory panel → IPC bridge: requests memory
