# zaidbuilds/hey-jarvis architecture

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

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

## Overview

#### Purpose and entry points
Jarvis is a Python 3.10+ local voice-controlled assistant for wake-word interaction, speech I/O, productivity actions, system automation, and LLM-assisted workflows. The documented launch is `main.py`; packaged/module startup is also represented by `src/jarvis/main.py` and `src/jarvis/__main__.py`. Runtime/service launch wrappers live in `scripts/runtime/run.py` and `scripts/runtime/service_run.py`.

#### Runtime composition
The central runtime is split between a legacy/core command path and newer service-oriented orchestration. Core state, commands, intent handling, automation, permissions, memory, and tool execution are concentrated in `src/jarvis/core/orchestrator.py`, `src/jarvis/core/command.py`, and `src/jarvis/core/tool_executor.py`. Service startup and platform assembly are handled by `src/jarvis/services/startup.py`, `src/jarvis/services/platform.py`, and `src/jarvis/services/server.py`.

#### Voice interaction pipeline
Audio input is gated by wake-word detection, transcribed to text, routed through intent/action logic, then returned through TTS. The primary boundary is `src/jarvis/audio/wakeword.py`, `src/jarvis/audio/stt.py`, and `src/jarvis/audio/tts.py`; higher-level coordination exists in `src/jarvis/services/voice_orchestrator.py` and `src/jarvis/services/voice_service.py`. Local speech-model artifacts are bundled under `data/models/`, while face-auth training assets reside in `data/auth/`.

#### AI, intent, and agents
Natural-language interpretation can use local Ollama or remote model adapters. Model selection is centralized in `src/jarvis/models/router.py`, with Gemini, Groq, and Ollama integrations at `src/jarvis/models/gemini_model.py`, `src/jarvis/models/groq_model.py`, and `src/jarvis/models/ollama_model.py`. Agentic decomposition is represented by `src/jarvis/ai/agentic_engine.py` and role-specific agents in `src/jarvis/agents/intent_agent.py` and `src/jarvis/agents/execution_agent.py`.

#### Planning, workflows, and managed agents
The system supports planning, scheduled/proactive work, and multi-step business workflows beyond simple commands. Planning and scheduling surfaces are `src/jarvis/services/planner.py`, `src/jarvis/services/scheduler.py`, and `src/jarvis/services/workflows.py`. The brain layer provides manifest-driven specialized agent workflows, including `src/jarvis/brain/runtime.py`, `src/jarvis/brain/manifests.py`, `src/jarvis/brain/freelance_flow.py`; corresponding role definitions are in `configs/agent-manifests/`.

#### Execution boundaries and extensibility
Actions flow from interpreted intent/plans to a tool catalog, policy checks, and executors rather than directly from model output to the host. Key enforcement points are `src/jarvis/core/tool_catalog.py`, `src/jarvis/core/tool_policy.py`, and `src/jarvis/services/boundary.py`. Concrete host/browser/filesystem operations are implemented under `src/jarvis/tools/automation.py`, `src/jarvis/tools/browser.py`, and `src/jarvis/tools/file_ops.py`. Plugin discovery and built-in capabilities use `src/jarvis/plugins/registry.py` and `src/jarvis/plugins/builtin/`.

#### State, clients, and surfaces
Persistent memory/database responsibilities are separated into `src/jarvis/core/persistent_memory.py`, `src/jarvis/database/db.py`, and `src/jarvis/database/memory_db.py`. The assistant exposes local API/UI bridge and client integration surfaces through `src/jarvis/services/local_api.py`, `src/jarvis/services/ui_bridge.py`, and `src/jarvis/services/clients.py`; a static dashboard exists at `src/jarvis/ui/web/index.html`. External dependencies include speech-recognition/TTS libraries, OpenAI/LangChain per README, optional Ollama, Gemini, and Groq model services, plus OS-level automation and browser integrations.

Main entry points: [`src/jarvis/core/orchestrator.py`](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/core/orchestrator.py) (Core command runtime), [`src/jarvis/core/tool_catalog.py`](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/core/tool_catalog.py) (Tool catalog), [`src/jarvis/services/platform.py`](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/services/platform.py) (Platform server), [`src/jarvis/services/planner.py`](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/services/planner.py) (Planner & scheduler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry &amp; Platform"]
  node_launch["Launch entry points<br/>Python entrypoint<br/>[main.py]"]
  node_startup["Service startup<br/>startup assembly<br/>[startup.py]"]
  node_platform["Platform server<br/>service host<br/>[platform.py]"]
end

subgraph group_voice["Voice Interaction"]
  node_voice_orchestrator["Voice orchestration<br/>voice coordinator"]
  node_wakeword["Wake-word gate<br/>audio input<br/>[wakeword.py]"]
  node_stt["Speech-to-text<br/>transcription<br/>[stt.py]"]
  node_tts["Text-to-speech<br/>speech output<br/>[tts.py]"]
end

subgraph group_intelligence["Intelligence &amp; Workflows"]
  node_core["Core command runtime<br/>command orchestration<br/>[orchestrator.py]"]
  node_models{{"Model router<br/>LLM selection<br/>[router.py]"}}
  node_agents["Agentic engine<br/>agent coordination<br/>[agentic_engine.py]"]
  node_planner["Planner &amp; scheduler<br/>proactive workflows<br/>[planner.py]"]
  node_brain["Managed agent runtime<br/>manifest workflows<br/>[runtime.py]"]
  node_agent_manifests["Agent manifests<br/>role definitions"]
end

subgraph group_execution["Policy &amp; Execution"]
  node_tool_catalog["Tool catalog<br/>capability registry<br/>[tool_catalog.py]"]
  node_policy{{"Tool policy<br/>permission enforcement<br/>[tool_policy.py]"}}
  node_boundary{{"Execution boundary<br/>service guard<br/>[boundary.py]"}}
  node_tool_executor["Tool executor<br/>action runner<br/>[tool_executor.py]"]
  node_host_tools["Host and browser tools<br/>automation adapters<br/>[automation.py]"]
  node_plugins["Plugin registry<br/>extension discovery<br/>[registry.py]"]
end

subgraph group_state["State &amp; Surfaces"]
  node_memory[("Persistent memory<br/>assistant state")]
  node_database[("Memory database<br/>storage<br/>[memory_db.py]")]
  node_local_surfaces["Local API and UI bridge<br/>client integration<br/>[local_api.py]"]
  node_dashboard["Web dashboard<br/>static UI<br/>[index.html]"]
end

node_launch -->|"starts services"| node_startup
node_startup -->|"assembles"| node_platform
node_platform -->|"hosts"| node_voice_orchestrator
node_platform -->|"exposes"| node_local_surfaces
node_voice_orchestrator -->|"listens"| node_wakeword
node_wakeword -->|"on wake"| node_stt
node_stt -->|"transcript"| node_core
node_core -->|"response text"| node_tts
node_core -->|"interprets requests"| node_models
node_models -->|"LLM assistance"| node_agents
node_agents -->|"multi-step work"| node_planner
node_planner -->|"managed workflows"| node_brain
node_agent_manifests -->|"defines roles"| node_brain
node_core -->|"selects capability"| node_tool_catalog
node_planner -->|"planned actions"| node_tool_catalog
node_tool_catalog -->|"requested tool"| node_policy
node_policy -->|"approved action"| node_boundary
node_boundary -->|"permits execution"| node_tool_executor
node_tool_executor -->|"invokes"| node_host_tools
node_plugins -->|"registers tools"| node_tool_catalog
node_core -->|"reads and writes"| node_memory
node_memory -->|"persists"| node_database
node_local_surfaces -->|"client requests"| node_core
node_local_surfaces -->|"serves bridge"| node_dashboard

click node_launch "https://github.com/zaidbuilds/hey-jarvis/blob/main/main.py"
click node_startup "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/services/startup.py"
click node_platform "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/services/platform.py"
click node_voice_orchestrator "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/services/voice_orchestrator.py"
click node_wakeword "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/audio/wakeword.py"
click node_stt "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/audio/stt.py"
click node_tts "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/audio/tts.py"
click node_core "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/core/orchestrator.py"
click node_models "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/models/router.py"
click node_agents "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/ai/agentic_engine.py"
click node_planner "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/services/planner.py"
click node_brain "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/brain/runtime.py"
click node_agent_manifests "https://github.com/zaidbuilds/hey-jarvis/blob/main/configs/agent-manifests/1_Central_Control_Bot.json"
click node_tool_catalog "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/core/tool_catalog.py"
click node_policy "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/core/tool_policy.py"
click node_boundary "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/services/boundary.py"
click node_tool_executor "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/core/tool_executor.py"
click node_host_tools "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/tools/automation.py"
click node_plugins "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/plugins/registry.py"
click node_memory "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/core/persistent_memory.py"
click node_database "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/database/memory_db.py"
click node_local_surfaces "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/services/local_api.py"
click node_dashboard "https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/ui/web/index.html"

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_launch,node_startup,node_platform toneBlue
class node_voice_orchestrator,node_wakeword,node_stt,node_tts toneAmber
class node_core,node_models,node_agents,node_planner,node_brain,node_agent_manifests toneMint
class node_tool_catalog,node_policy,node_boundary,node_tool_executor,node_host_tools,node_plugins toneRose
class node_memory,node_database,node_local_surfaces,node_dashboard toneIndigo
```

## Components

### Entry & Platform

- [Launch entry points](https://github.com/zaidbuilds/hey-jarvis/blob/main/main.py): Python entrypoint · Script, module, and runtime wrappers start the assistant. · `main.py`
- [Service startup](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/services/startup.py): startup assembly · `src/jarvis/services/startup.py`
- [Platform server](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/services/platform.py): service host · `src/jarvis/services/platform.py`

### Voice Interaction

- [Voice orchestration](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/services/voice_orchestrator.py): voice coordinator · `src/jarvis/services/voice_orchestrator.py`
- [Wake-word gate](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/audio/wakeword.py): audio input · `src/jarvis/audio/wakeword.py`
- [Speech-to-text](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/audio/stt.py): transcription · Uses bundled local speech models. · `src/jarvis/audio/stt.py`
- [Text-to-speech](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/audio/tts.py): speech output · `src/jarvis/audio/tts.py`

### Intelligence & Workflows

- [Core command runtime](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/core/orchestrator.py): command orchestration · Maintains command state and routes interpreted requests. · `src/jarvis/core/orchestrator.py`
- [Model router](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/models/router.py): LLM selection · Selects local Ollama or remote Gemini and Groq adapters. · `src/jarvis/models/router.py`
- [Agentic engine](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/ai/agentic_engine.py): agent coordination · Decomposes work through intent and execution agents. · `src/jarvis/ai/agentic_engine.py`
- [Planner & scheduler](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/services/planner.py): proactive workflows · Plans multi-step, scheduled, and business workflows. · `src/jarvis/services/planner.py`
- [Managed agent runtime](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/brain/runtime.py): manifest workflows · Runs specialized manifest-driven agent flows. · `src/jarvis/brain/runtime.py`
- [Agent manifests](https://github.com/zaidbuilds/hey-jarvis/blob/main/configs/agent-manifests/1_Central_Control_Bot.json): role definitions · `configs/agent-manifests/1_Central_Control_Bot.json`

### Policy & Execution

- [Tool catalog](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/core/tool_catalog.py): capability registry · `src/jarvis/core/tool_catalog.py`
- [Tool policy](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/core/tool_policy.py): permission enforcement · Checks actions before host execution. · `src/jarvis/core/tool_policy.py`
- [Execution boundary](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/services/boundary.py): service guard · `src/jarvis/services/boundary.py`
- [Tool executor](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/core/tool_executor.py): action runner · `src/jarvis/core/tool_executor.py`
- [Host and browser tools](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/tools/automation.py): automation adapters · Provides automation, browser, and filesystem operations. · `src/jarvis/tools/automation.py`
- [Plugin registry](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/plugins/registry.py): extension discovery · Discovers built-in and external capabilities. · `src/jarvis/plugins/registry.py`

### State & Surfaces

- [Persistent memory](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/core/persistent_memory.py): assistant state · `src/jarvis/core/persistent_memory.py`
- [Memory database](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/database/memory_db.py): storage · `src/jarvis/database/memory_db.py`
- [Local API and UI bridge](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/services/local_api.py): client integration · Connects local clients and the dashboard. · `src/jarvis/services/local_api.py`
- [Web dashboard](https://github.com/zaidbuilds/hey-jarvis/blob/main/src/jarvis/ui/web/index.html): static UI · `src/jarvis/ui/web/index.html`

## Connections

- Launch entry points → Service startup: starts services
- Service startup → Platform server: assembles
- Platform server → Voice orchestration: hosts
- Platform server → Local API and UI bridge: exposes
- Voice orchestration → Wake-word gate: listens
- Wake-word gate → Speech-to-text: on wake
- Speech-to-text → Core command runtime: transcript
- Core command runtime → Text-to-speech: response text
- Core command runtime → Model router: interprets requests
- Model router → Agentic engine: LLM assistance
- Agentic engine → Planner & scheduler: multi-step work
- Planner & scheduler → Managed agent runtime: managed workflows
- Agent manifests → Managed agent runtime: defines roles
- Core command runtime → Tool catalog: selects capability
- Planner & scheduler → Tool catalog: planned actions
- Tool catalog → Tool policy: requested tool
- Tool policy → Execution boundary: approved action
- Execution boundary → Tool executor: permits execution
- Tool executor → Host and browser tools: invokes
- Plugin registry → Tool catalog: registers tools
- Core command runtime → Persistent memory: reads and writes
- Persistent memory → Memory database: persists
- Local API and UI bridge → Core command runtime: client requests
- Local API and UI bridge → Web dashboard: serves bridge
