# gamerio2904/jarvis architecture

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

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

## Overview

Jarvis is a private, phone-first assistant: a user speaks or types in the app, the chat path processes the request, and the assistant responds or invokes a domain capability. The README describes Groq as the primary model, Gemini for vision and deep research, and a local fallback, plus a Director and domain-agent network. The graph preserves documented capabilities and sampled boundaries; several feature links are documented rather than verified in sampled implementation, so those edges are dashed.

Main entry points: [`frontend/src/engine/chat.ts`](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/chat.ts) (Chat engine), [`frontend/src/api.ts`](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/api.ts) (App API), [`frontend/src/App.tsx`](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/App.tsx) (App shell), [`frontend/src/engine/store.ts`](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/store.ts) (IndexedDB store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_settings["Settings UI<br/>[SettingsScreen.tsx]"]
  node_lage["Lage dashboard<br/>[Lage.tsx]"]
  node_api["App API<br/>[api.ts]"]
end

subgraph group_intelligence["Assistant intelligence"]
  node_chat["Chat engine<br/>[chat.ts]"]
  node_agents["Agent network"]
  node_tools["Tool dispatch<br/>[tools.ts]"]
  node_utterance["Speech processing<br/>[utterance.ts]"]
end

subgraph group_knowledge["Memory and knowledge"]
  node_store[("IndexedDB store<br/>[store.ts]")]
  node_knowledge[("Knowledge store<br/>[knowledge-store.ts]")]
  node_retrieve["Knowledge retrieval<br/>[retrieve.ts]"]
end

subgraph group_capabilities["Domain capabilities"]
  node_calendar["Calendar<br/>[calendar.ts]"]
  node_chess["Chess<br/>[chess.ts]"]
  node_globe["Globe mapping<br/>[globe-geo.ts]"]
  node_device["Device control"]
  node_home["Home control"]
  node_tv["TV control"]
end

subgraph group_android["Android services"]
  node_voice["Voice bridge<br/>[voice.ts]"]
  node_wake["Wake service"]
  node_notifications["Alarms and inbox"]
end

node_user(("User"))
node_groq{{"Groq model"}}
node_gemini{{"Gemini model"}}
node_localmodel{{"Local model"}}
node_pc["JarvisPC<br/>[jarvis-pc.mjs]"]
node_clip["YouTube clip jobs<br/>[clip-job.mjs]"]

node_user -->|"speaks or types"| node_app
node_app -->|"streams chat"| node_api
node_app -->|"loads settings"| node_store
node_app -->|"starts wake word"| node_voice
node_api -->|"calls"| node_chat
node_api -->|"reads and writes"| node_store
node_chat -.->|"routes requests"| node_agents
node_agents -.->|"dispatches tools"| node_tools
node_chat -.->|"uses primary model"| node_groq
node_chat -.->|"uses specialist model"| node_gemini
node_chat -.->|"falls back"| node_localmodel
node_chat -.->|"formats response"| node_utterance
node_chat -.->|"persists conversation"| node_store
node_retrieve -->|"reads stored data"| node_store
node_retrieve -->|"retrieves packs"| node_knowledge
node_lage -->|"lists packs"| node_knowledge
node_lage -->|"retrieves packs"| node_retrieve
node_lage -->|"loads settings"| node_store
node_tools -.->|"invokes"| node_calendar
node_tools -.->|"invokes"| node_chess
node_tools -.->|"invokes"| node_globe
node_api -.->|"bridges device features"| node_device
node_api -.->|"bridges home control"| node_home
node_api -.->|"bridges TV control"| node_tv
node_voice -.->|"controls wake service"| node_wake
node_app -.->|"uses alarms"| node_notifications
node_user -->|"pairs by QR"| node_pc
node_pc -->|"runs clip jobs"| node_clip

click node_app "https://github.com/gamerio2904/jarvis/blob/main/frontend/src/App.tsx"
click node_settings "https://github.com/gamerio2904/jarvis/blob/main/frontend/src/ui/SettingsScreen.tsx"
click node_lage "https://github.com/gamerio2904/jarvis/blob/main/frontend/src/ui/lage/Lage.tsx"
click node_api "https://github.com/gamerio2904/jarvis/blob/main/frontend/src/api.ts"
click node_chat "https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/chat.ts"
click node_agents "https://github.com/gamerio2904/jarvis/tree/main/frontend/src/engine/agents"
click node_tools "https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/tools.ts"
click node_utterance "https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/utterance.ts"
click node_store "https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/store.ts"
click node_knowledge "https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/knowledge-store.ts"
click node_retrieve "https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/retrieve.ts"
click node_calendar "https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/calendar.ts"
click node_chess "https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/chess.ts"
click node_globe "https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/globe-geo.ts"
click node_device "https://github.com/gamerio2904/jarvis/blob/main/frontend/native/device/JarvisDevicePlugin.java"
click node_home "https://github.com/gamerio2904/jarvis/blob/main/frontend/native/home/JarvisHomePlugin.java"
click node_tv "https://github.com/gamerio2904/jarvis/blob/main/frontend/native/tv/JarvisTvPlugin.java"
click node_voice "https://github.com/gamerio2904/jarvis/blob/main/frontend/src/native/voice.ts"
click node_wake "https://github.com/gamerio2904/jarvis/blob/main/frontend/native/voice/JarvisWakeService.java"
click node_notifications "https://github.com/gamerio2904/jarvis/blob/main/frontend/native/notify/JarvisNotifyPlugin.java"
click node_pc "https://github.com/gamerio2904/jarvis/blob/main/desktop/jarvis-pc.mjs"
click node_clip "https://github.com/gamerio2904/jarvis/blob/main/desktop/clip-job.mjs"

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_app,node_settings,node_lage,node_api,node_user toneBlue
class node_chat,node_agents,node_tools,node_utterance toneAmber
class node_store,node_knowledge,node_retrieve toneMint
class node_calendar,node_chess,node_globe,node_device,node_home,node_tv toneRose
class node_voice,node_wake,node_notifications,node_groq,node_gemini,node_localmodel toneIndigo
class node_pc,node_clip toneTeal
```

## Components

### App experience

- [App shell](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Settings UI](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/ui/SettingsScreen.tsx): `frontend/src/ui/SettingsScreen.tsx`
- [Lage dashboard](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/ui/lage/Lage.tsx): `frontend/src/ui/lage/Lage.tsx`
- [App API](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/api.ts): `frontend/src/api.ts`

### Assistant intelligence

- [Chat engine](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/chat.ts): `frontend/src/engine/chat.ts`
- [Agent network](https://github.com/gamerio2904/jarvis/tree/main/frontend/src/engine/agents): `frontend/src/engine/agents`
- [Tool dispatch](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/tools.ts): `frontend/src/engine/tools.ts`
- [Speech processing](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/utterance.ts): `frontend/src/engine/utterance.ts`

### Memory and knowledge

- [IndexedDB store](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/store.ts): `frontend/src/engine/store.ts`
- [Knowledge store](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/knowledge-store.ts): `frontend/src/engine/knowledge-store.ts`
- [Knowledge retrieval](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/retrieve.ts): `frontend/src/engine/retrieve.ts`

### Domain capabilities

- [Calendar](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/calendar.ts): `frontend/src/engine/calendar.ts`
- [Chess](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/chess.ts): `frontend/src/engine/chess.ts`
- [Globe mapping](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/engine/globe-geo.ts): `frontend/src/engine/globe-geo.ts`
- [Device control](https://github.com/gamerio2904/jarvis/blob/main/frontend/native/device/JarvisDevicePlugin.java): `frontend/native/device/JarvisDevicePlugin.java`
- [Home control](https://github.com/gamerio2904/jarvis/blob/main/frontend/native/home/JarvisHomePlugin.java): `frontend/native/home/JarvisHomePlugin.java`
- [TV control](https://github.com/gamerio2904/jarvis/blob/main/frontend/native/tv/JarvisTvPlugin.java): `frontend/native/tv/JarvisTvPlugin.java`

### Android services

- [Voice bridge](https://github.com/gamerio2904/jarvis/blob/main/frontend/src/native/voice.ts): `frontend/src/native/voice.ts`
- [Wake service](https://github.com/gamerio2904/jarvis/blob/main/frontend/native/voice/JarvisWakeService.java): `frontend/native/voice/JarvisWakeService.java`
- [Alarms and inbox](https://github.com/gamerio2904/jarvis/blob/main/frontend/native/notify/JarvisNotifyPlugin.java): `frontend/native/notify/JarvisNotifyPlugin.java`

### Other components

- **User**
- **Groq model**
- **Gemini model**
- **Local model**
- [JarvisPC](https://github.com/gamerio2904/jarvis/blob/main/desktop/jarvis-pc.mjs): `desktop/jarvis-pc.mjs`
- [YouTube clip jobs](https://github.com/gamerio2904/jarvis/blob/main/desktop/clip-job.mjs): `desktop/clip-job.mjs`

## Connections

- User → App shell: speaks or types
- App shell → App API: streams chat (evidence: `frontend/src/App.tsx`)
- App shell → IndexedDB store: loads settings (evidence: `frontend/src/App.tsx`)
- App shell → Voice bridge: starts wake word (evidence: `frontend/src/App.tsx`)
- App API → Chat engine: calls (evidence: `frontend/src/api.ts`)
- App API → IndexedDB store: reads and writes (evidence: `frontend/src/api.ts`)
- Chat engine → Agent network: routes requests
- Agent network → Tool dispatch: dispatches tools
- Chat engine → Groq model: uses primary model
- Chat engine → Gemini model: uses specialist model
- Chat engine → Local model: falls back
- Chat engine → Speech processing: formats response
- Chat engine → IndexedDB store: persists conversation
- Knowledge retrieval → IndexedDB store: reads stored data (evidence: `frontend/src/engine/retrieve.ts`)
- Knowledge retrieval → Knowledge store: retrieves packs (evidence: `frontend/src/engine/retrieve.ts`)
- Lage dashboard → Knowledge store: lists packs (evidence: `frontend/src/ui/lage/Lage.tsx`)
- Lage dashboard → Knowledge retrieval: retrieves packs (evidence: `frontend/src/ui/lage/Lage.tsx`)
- Lage dashboard → IndexedDB store: loads settings (evidence: `frontend/src/ui/lage/Lage.tsx`)
- Tool dispatch → Calendar: invokes
- Tool dispatch → Chess: invokes (evidence: `frontend/src/engine/chess.ts`)
- Tool dispatch → Globe mapping: invokes
- App API → Device control: bridges device features
- App API → Home control: bridges home control
- App API → TV control: bridges TV control
- Voice bridge → Wake service: controls wake service
- App shell → Alarms and inbox: uses alarms
- User → JarvisPC: pairs by QR
- JarvisPC → YouTube clip jobs: runs clip jobs (evidence: `desktop/jarvis-pc.mjs`)
