# panpenek/jarvisai architecture

> Architecture diagram of the GitHub repository panpenek/jarvisai, 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/panpenek/jarvisai
- Repository: https://github.com/panpenek/jarvisai

## Overview

J.A.R.V.I.S. is a local, voice-first desktop assistant with a parallel web-chat interface. The voice workflow detects a wake word, records and transcribes speech, then hands the request to the orchestrator for provider-backed reasoning and tool dispatch; it stores conversation context and speaks the response. Its documented capabilities also include screen vision, desktop/app and system control, web search, file operations, subagent delegation, persistent memory, and configurable providers and settings. README and sampled files establish the main links; some feature-level wiring is documented but not excerpted.

Main entry points: [`jarvis/main.py`](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/main.py) (Request orchestrator), [`jarvis/tools/router.py`](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/router.py) (Tool router), [`jarvis/web.py`](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/web.py) (Web chat and APIs), [`jarvis/static/index.html`](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/static/index.html) (HUD interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_wake["Wake detection<br/>[wake.py]"]
  node_speech["Speech capture and STT<br/>[stt.py]"]
  node_speech_output["Speech synthesis<br/>[tts.py]"]
  node_web_server["Web chat and APIs<br/>[web.py]"]
  node_web_ui["HUD interface<br/>[index.html]"]
end

subgraph group_reasoning["Assistant reasoning"]
  node_orchestrator["Request orchestrator<br/>[main.py]"]
  node_provider["LLM provider calls<br/>[main.py]"]
  node_internal_llm["Internal LLM chat<br/>[llm.py]"]
  node_tool_router["Tool router<br/>[router.py]"]
end

subgraph group_tools["Action tools"]
  node_desktop["Screen and desktop<br/>[desktop.py]"]
  node_app_control["App control<br/>[app_control.py]"]
  node_web_tools["Search and fetch<br/>[web_search.py]"]
  node_file_ops["File operations<br/>[file_ops.py]"]
  node_code_exec["Python execution<br/>[code_exec.py]"]
  node_system["System controls<br/>[system.py]"]
  node_subagent["Task delegation<br/>[subagent.py]"]
end

subgraph group_state["Conversation state"]
  node_context["Context window<br/>[context.py]"]
  node_memory[("Persistent memory<br/>[memory.py]")]
end

node_voice_user(("Voice user"))
node_web_user(("Web user"))

node_voice_user -->|"speaks wake word"| node_wake
node_wake -->|"starts listening"| node_speech
node_speech -->|"transcribed request"| node_orchestrator
node_orchestrator -->|"requests response"| node_provider
node_orchestrator -->|"dispatches tools"| node_tool_router
node_tool_router -->|"dispatches desktop tools"| node_desktop
node_tool_router -->|"dispatches app tools"| node_app_control
node_tool_router -->|"dispatches web tools"| node_web_tools
node_tool_router -->|"dispatches file tools"| node_file_ops
node_tool_router -->|"dispatches code tool"| node_code_exec
node_tool_router -->|"dispatches system tools"| node_system
node_tool_router -->|"dispatches delegation"| node_subagent
node_orchestrator -->|"updates context"| node_context
node_context -->|"summarizes context"| node_internal_llm
node_orchestrator -->|"extracts facts"| node_memory
node_orchestrator -->|"speaks response"| node_speech_output
node_web_user -->|"types request"| node_web_ui
node_web_ui -->|"sends chat"| node_web_server
node_web_server -->|"processes chat"| node_orchestrator
node_orchestrator -->|"broadcasts events"| node_web_server
node_web_server -->|"serves interface"| node_web_ui
node_web_server -->|"configures providers"| node_orchestrator
node_provider -.->|"may share provider settings"| node_internal_llm

click node_wake "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/wake.py"
click node_speech "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/stt.py"
click node_orchestrator "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/main.py"
click node_provider "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/main.py"
click node_internal_llm "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/llm.py"
click node_tool_router "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/router.py"
click node_speech_output "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tts.py"
click node_web_server "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/web.py"
click node_web_ui "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/static/index.html"
click node_context "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/context.py"
click node_memory "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/memory.py"
click node_desktop "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/desktop.py"
click node_app_control "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/app_control.py"
click node_web_tools "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/web_search.py"
click node_file_ops "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/file_ops.py"
click node_code_exec "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/code_exec.py"
click node_system "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/system.py"
click node_subagent "https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/subagent.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_speech_output,node_web_server,node_web_ui,node_voice_user,node_web_user toneBlue
class node_orchestrator,node_provider,node_internal_llm,node_tool_router toneAmber
class node_desktop,node_app_control,node_web_tools,node_file_ops,node_code_exec,node_system,node_subagent toneMint
class node_context,node_memory toneRose
```

## Components

### User interaction

- [Wake detection](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/wake.py): `jarvis/wake.py`
- [Speech capture and STT](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/stt.py): `jarvis/stt.py`
- [Speech synthesis](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tts.py): `jarvis/tts.py`
- [Web chat and APIs](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/web.py): `jarvis/web.py`
- [HUD interface](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/static/index.html): `jarvis/static/index.html`

### Assistant reasoning

- [Request orchestrator](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/main.py): `jarvis/main.py`
- [LLM provider calls](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/main.py): `jarvis/main.py`
- [Internal LLM chat](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/llm.py): `jarvis/llm.py`
- [Tool router](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/router.py): `jarvis/tools/router.py`

### Action tools

- [Screen and desktop](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/desktop.py): `jarvis/tools/desktop.py`
- [App control](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/app_control.py): `jarvis/tools/app_control.py`
- [Search and fetch](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/web_search.py): `jarvis/tools/web_search.py`
- [File operations](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/file_ops.py): `jarvis/tools/file_ops.py`
- [Python execution](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/code_exec.py): `jarvis/tools/code_exec.py`
- [System controls](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/system.py): `jarvis/tools/system.py`
- [Task delegation](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/tools/subagent.py): `jarvis/tools/subagent.py`

### Conversation state

- [Context window](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/context.py): `jarvis/context.py`
- [Persistent memory](https://github.com/PanPenek/JarvisAi/blob/main/jarvis/memory.py): `jarvis/memory.py`

### Other components

- **Voice user**
- **Web user**

## Connections

- Voice user → Wake detection: speaks wake word (evidence: `README.md`)
- Wake detection → Speech capture and STT: starts listening (evidence: `README.md`)
- Speech capture and STT → Request orchestrator: transcribed request (evidence: `README.md`)
- Request orchestrator → LLM provider calls: requests response (evidence: `jarvis/main.py`)
- Request orchestrator → Tool router: dispatches tools (evidence: `jarvis/main.py`)
- Tool router → Screen and desktop: dispatches desktop tools (evidence: `jarvis/tools/router.py`)
- Tool router → App control: dispatches app tools (evidence: `jarvis/tools/router.py`)
- Tool router → Search and fetch: dispatches web tools (evidence: `jarvis/tools/router.py`)
- Tool router → File operations: dispatches file tools (evidence: `jarvis/tools/router.py`)
- Tool router → Python execution: dispatches code tool (evidence: `jarvis/tools/router.py`)
- Tool router → System controls: dispatches system tools (evidence: `jarvis/tools/router.py`)
- Tool router → Task delegation: dispatches delegation (evidence: `jarvis/tools/router.py`)
- Request orchestrator → Context window: updates context (evidence: `jarvis/main.py`)
- Context window → Internal LLM chat: summarizes context (evidence: `jarvis/context.py`)
- Request orchestrator → Persistent memory: extracts facts (evidence: `jarvis/main.py`)
- Request orchestrator → Speech synthesis: speaks response (evidence: `jarvis/main.py`)
- Web user → HUD interface: types request (evidence: `README.md`)
- HUD interface → Web chat and APIs: sends chat (evidence: `README.md`)
- Web chat and APIs → Request orchestrator: processes chat (evidence: `jarvis/web.py`)
- Request orchestrator → Web chat and APIs: broadcasts events (evidence: `jarvis/main.py`)
- Web chat and APIs → HUD interface: serves interface (evidence: `jarvis/web.py`)
- Web chat and APIs → Request orchestrator: configures providers (evidence: `jarvis/web.py`)
- LLM provider calls → Internal LLM chat: may share provider settings
