# kucau0901/jarvis-voice-agent architecture

> Architecture diagram of the GitHub repository kucau0901/jarvis-voice-agent, 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/kucau0901/jarvis-voice-agent
- Repository: https://github.com/kucau0901/jarvis-voice-agent

## Overview

Jarvis is a browser-based, hands-free assistant backed by a Cloudflare Worker. A person unlocks or pairs a screen, then speaks live, uses push-to-talk, or types; the Worker routes requests through a model and tools, returning speech, text, or display content. Distinct product branches include memory, alerts, background jobs, routines, family/device access, camera vision, and integrations. The graph uses README statements for documented capabilities and sampled imports for visible wiring; many individual route-to-service calls were not sampled, so those links are intentionally not asserted.

Main entry points: [`src/app/main.ts`](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/app/main.ts) (Jarvis screen), [`src/worker/index.ts`](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/index.ts) (HTTP entry), [`src/worker/lib/router.ts`](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/router.ts) (Tool router), [`src/worker/routes/router.ts`](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/routes/router.ts) (Router endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser experience"]
  node_app["Jarvis screen<br/>[main.ts]"]
  node_voice["Live voice<br/>[loud.ts]"]
  node_ptt["Push to talk<br/>[ptt.ts]"]
  node_typed["Typed chat<br/>[chat.ts]"]
  node_familyui["Family controls<br/>[Family.ts]"]
  node_alertsui["Alert delivery UI<br/>[alerts.ts]"]
end

subgraph group_worker["Worker runtime"]
  node_workerentry["HTTP entry<br/>[index.ts]"]
  node_auth["Identity and access<br/>[access.ts]"]
  node_routerroute["Router endpoint<br/>[router.ts]"]
end

subgraph group_assistant["Assistant capabilities"]
  node_router["Tool router<br/>[router.ts]"]
  node_routermodel["Model selection<br/>[router-model.ts]"]
  node_toolregistry["Tool registry<br/>[registry.ts]"]
  node_externaltools{{"Connected services"}}
  node_camera["Camera vision<br/>[cameras.ts]"]
end

subgraph group_state["State and automation"]
  node_memory["Memory<br/>[memory.ts]"]
  node_stateobject[("Persistent state<br/>[state.ts]")]
  node_jobs["Background jobs<br/>[jobs.ts]"]
  node_routines["Routines and watches<br/>[routines.ts]"]
  node_alerts["Alerts and relays<br/>[alerts.ts]"]
end

node_person(("Person"))
node_pushservice{{"Push notifications"}}
node_mcp{{"MCP agents"}}

node_person -->|"uses"| node_app
node_app -->|"starts voice"| node_voice
node_app -->|"offers mode"| node_ptt
node_app -->|"offers mode"| node_typed
node_app -->|"opens controls"| node_familyui
node_app -->|"fetches alerts"| node_alertsui
node_app -->|"sends requests"| node_workerentry
node_workerentry -->|"checks access"| node_auth
node_workerentry -->|"routes requests"| node_routerroute
node_routerroute -->|"selects model"| node_routermodel
node_router -->|"resolves model"| node_routermodel
node_router -->|"loads tools"| node_toolregistry
node_toolregistry -->|"registers integrations"| node_externaltools
node_person -->|"asks about scene"| node_camera
node_person -->|"shares facts"| node_memory
node_memory -->|"persists in"| node_stateobject
node_person -->|"requests research"| node_jobs
node_jobs -->|"delivers result"| node_alerts
node_person -->|"sets routine"| node_routines
node_routines -->|"runs from"| node_stateobject
node_alerts -->|"sends notifications"| node_pushservice
node_person -.->|"connects agent"| node_mcp

click node_app "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/app/main.ts"
click node_voice "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/app/loud.ts"
click node_ptt "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/app/ptt.ts"
click node_typed "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/app/chat.ts"
click node_familyui "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/app/ui/Family.ts"
click node_alertsui "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/app/alerts.ts"
click node_workerentry "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/index.ts"
click node_auth "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/access.ts"
click node_routerroute "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/routes/router.ts"
click node_router "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/router.ts"
click node_routermodel "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/router-model.ts"
click node_toolregistry "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/tools/registry.ts"
click node_externaltools "https://github.com/kucau0901/jarvis-voice-agent/tree/main/src/worker/tools"
click node_camera "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/cameras.ts"
click node_memory "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/memory.ts"
click node_stateobject "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/state.ts"
click node_jobs "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/jobs.ts"
click node_routines "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/routines.ts"
click node_alerts "https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/alerts.ts"

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_voice,node_ptt,node_typed,node_familyui,node_alertsui toneBlue
class node_workerentry,node_auth,node_routerroute toneAmber
class node_router,node_routermodel,node_toolregistry,node_externaltools,node_camera toneMint
class node_memory,node_stateobject,node_jobs,node_routines,node_alerts toneRose
class node_person,node_pushservice,node_mcp toneIndigo
```

## Components

### Browser experience

- [Jarvis screen](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/app/main.ts): `src/app/main.ts`
- [Live voice](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/app/loud.ts): `src/app/loud.ts`
- [Push to talk](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/app/ptt.ts): `src/app/ptt.ts`
- [Typed chat](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/app/chat.ts): `src/app/chat.ts`
- [Family controls](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/app/ui/Family.ts): `src/app/ui/Family.ts`
- [Alert delivery UI](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/app/alerts.ts): `src/app/alerts.ts`

### Worker runtime

- [HTTP entry](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/index.ts): `src/worker/index.ts`
- [Identity and access](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/access.ts): `src/worker/lib/access.ts`
- [Router endpoint](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/routes/router.ts): `src/worker/routes/router.ts`

### Assistant capabilities

- [Tool router](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/router.ts): `src/worker/lib/router.ts`
- [Model selection](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/router-model.ts): `src/worker/lib/router-model.ts`
- [Tool registry](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/tools/registry.ts): `src/worker/tools/registry.ts`
- [Connected services](https://github.com/kucau0901/jarvis-voice-agent/tree/main/src/worker/tools): `src/worker/tools`
- [Camera vision](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/cameras.ts): `src/worker/lib/cameras.ts`

### State and automation

- [Memory](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/memory.ts): `src/worker/lib/memory.ts`
- [Persistent state](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/state.ts): `src/worker/state.ts`
- [Background jobs](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/jobs.ts): `src/worker/lib/jobs.ts`
- [Routines and watches](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/routines.ts): `src/worker/lib/routines.ts`
- [Alerts and relays](https://github.com/kucau0901/jarvis-voice-agent/blob/main/src/worker/lib/alerts.ts): `src/worker/lib/alerts.ts`

### Other components

- **Person**
- **Push notifications**
- **MCP agents**

## Connections

- Person → Jarvis screen: uses (evidence: `README.md`)
- Jarvis screen → Live voice: starts voice (evidence: `src/app/main.ts`)
- Jarvis screen → Push to talk: offers mode (evidence: `README.md`)
- Jarvis screen → Typed chat: offers mode (evidence: `README.md`)
- Jarvis screen → Family controls: opens controls (evidence: `src/app/main.ts`)
- Jarvis screen → Alert delivery UI: fetches alerts (evidence: `src/app/main.ts`)
- Jarvis screen → HTTP entry: sends requests (evidence: `README.md`)
- HTTP entry → Identity and access: checks access (evidence: `src/worker/index.ts`)
- HTTP entry → Router endpoint: routes requests (evidence: `src/worker/index.ts`)
- Router endpoint → Model selection: selects model (evidence: `src/worker/routes/router.ts`)
- Tool router → Model selection: resolves model (evidence: `src/worker/lib/router.ts`)
- Tool router → Tool registry: loads tools (evidence: `src/worker/lib/router.ts`)
- Tool registry → Connected services: registers integrations (evidence: `src/worker/tools/registry.ts`)
- Person → Camera vision: asks about scene (evidence: `README.md`)
- Person → Memory: shares facts (evidence: `README.md`)
- Memory → Persistent state: persists in (evidence: `src/worker/state.ts`)
- Person → Background jobs: requests research (evidence: `README.md`)
- Background jobs → Alerts and relays: delivers result (evidence: `README.md`)
- Person → Routines and watches: sets routine (evidence: `README.md`)
- Routines and watches → Persistent state: runs from (evidence: `src/worker/state.ts`)
- Alerts and relays → Push notifications: sends notifications (evidence: `README.md`)
- Person → MCP agents: connects agent (evidence: `README.md`)
