# architaggarwal24/friday architecture

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

## Overview

F.R.I.D.A.Y. is a Windows-first multimodal desktop assistant. The main workflow accepts voice or UI input, routes it through LLM orchestration, and invokes handlers for tools or queued multi-step tasks; results can be spoken and surfaced in the Electron HUD. Separate branches cover productivity and desktop actions, safety and verification, voice, and persistent memory. Some subsystem links are documented or visible in the SOURCE INDEX rather than the excerpts, so uncertain implementation-level calls are omitted.

Main entry points: [`brain/llm.py`](https://github.com/architaggarwal24/friday/blob/main/brain/llm.py) (LLM and tools), [`brain/handlers.py`](https://github.com/architaggarwal24/friday/blob/main/brain/handlers.py) (Intent handlers), [`main.py`](https://github.com/architaggarwal24/friday/blob/main/main.py) (Backend entry), [`ui/ws_server.py`](https://github.com/architaggarwal24/friday/blob/main/ui/ws_server.py) (WebSocket bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Input and UI"]
  node_ui["Electron HUD<br/>[App.jsx]"]
  node_ws["WebSocket bridge<br/>[ws_server.py]"]
end

subgraph group_intelligence["Assistant orchestration"]
  node_backend["Backend entry<br/>[main.py]"]
  node_llm["LLM and tools<br/>[llm.py]"]
  node_model_router["Model routing<br/>[model_router.py]"]
  node_handlers["Intent handlers<br/>[handlers.py]"]
  node_planner["Task planner<br/>[planner.py]"]
  node_task_queue["Task queue<br/>[task_queue.py]"]
  node_executor["Task executor<br/>[executor.py]"]
end

subgraph group_actions["Actions and integrations"]
  node_desktop_actions["Desktop and browser"]
  node_file_actions["File operations"]
  node_productivity["Productivity tools"]
  node_gmail["Gmail<br/>[gmail.py]"]
  node_calendar["Calendar<br/>[calendar.py]"]
  node_google_auth["Google OAuth<br/>[google_auth.py]"]
end

subgraph group_state["Memory and safety"]
  node_sentinel["Risk classification<br/>[core.py]"]
  node_verifier["Action verification<br/>[core.py]"]
  node_memory[("Long-term vault<br/>[long_term.py]")]
  node_memory_store[("Encrypted local memory<br/>[memory_store.py]")]
  node_graph_export["Memory graph<br/>[graph_export.py]"]
end

subgraph group_voice["Voice pipeline"]
  node_voice_input["Voice input<br/>[wake.py]"]
  node_vad_stt["VAD and STT<br/>[stt.py]"]
  node_tts["Speech output<br/>[tts.py]"]
end

node_user(("User"))
node_llm_services["LLM providers"]
node_google["Google APIs"]

node_user -->|"speaks"| node_voice_input
node_voice_input -->|"captures speech"| node_vad_stt
node_backend -->|"initializes"| node_vad_stt
node_backend -->|"initializes"| node_voice_input
node_user -->|"uses"| node_ui
node_ui -->|"bridges commands"| node_ws
node_backend -->|"starts"| node_ws
node_ws -->|"routes UI input"| node_llm
node_vad_stt -.->|"provides transcript"| node_llm
node_backend -->|"starts assistant"| node_llm
node_llm -->|"selects provider"| node_model_router
node_model_router -->|"dispatches requests"| node_llm_services
node_llm -->|"dispatches tools"| node_handlers
node_llm -->|"plans tasks"| node_planner
node_llm -->|"submits tasks"| node_task_queue
node_task_queue -->|"requests plan"| node_planner
node_task_queue -->|"dispatches tasks"| node_executor
node_handlers -->|"invokes tools"| node_desktop_actions
node_handlers -->|"invokes tools"| node_file_actions
node_handlers -->|"invokes tools"| node_productivity
node_handlers -->|"invokes Gmail"| node_gmail
node_handlers -->|"invokes calendar"| node_calendar
node_gmail -->|"gets credentials"| node_google_auth
node_calendar -->|"gets credentials"| node_google_auth
node_google_auth -.->|"authorizes API access"| node_google
node_llm -->|"checks action risk"| node_sentinel
node_llm -->|"verifies results"| node_verifier
node_llm -->|"reads and writes"| node_memory
node_llm -->|"stores conversation data"| node_memory_store
node_memory_store -->|"uses vault memory"| node_memory
node_memory -->|"exports graph"| node_graph_export
node_llm -.->|"streams speech"| node_tts
node_tts -->|"reports audio state"| node_ws

click node_backend "https://github.com/architaggarwal24/friday/blob/main/main.py"
click node_ui "https://github.com/architaggarwal24/friday/blob/main/ui/renderer/App.jsx"
click node_ws "https://github.com/architaggarwal24/friday/blob/main/ui/ws_server.py"
click node_voice_input "https://github.com/architaggarwal24/friday/blob/main/voice/wake.py"
click node_vad_stt "https://github.com/architaggarwal24/friday/blob/main/voice/stt.py"
click node_llm "https://github.com/architaggarwal24/friday/blob/main/brain/llm.py"
click node_model_router "https://github.com/architaggarwal24/friday/blob/main/brain/model_router.py"
click node_handlers "https://github.com/architaggarwal24/friday/blob/main/brain/handlers.py"
click node_planner "https://github.com/architaggarwal24/friday/blob/main/agent/planner.py"
click node_task_queue "https://github.com/architaggarwal24/friday/blob/main/agent/task_queue.py"
click node_executor "https://github.com/architaggarwal24/friday/blob/main/agent/executor.py"
click node_desktop_actions "https://github.com/architaggarwal24/friday/tree/main/actions"
click node_file_actions "https://github.com/architaggarwal24/friday/tree/main/actions"
click node_productivity "https://github.com/architaggarwal24/friday/tree/main/actions"
click node_gmail "https://github.com/architaggarwal24/friday/blob/main/actions/gmail.py"
click node_calendar "https://github.com/architaggarwal24/friday/blob/main/actions/calendar.py"
click node_google_auth "https://github.com/architaggarwal24/friday/blob/main/actions/google_auth.py"
click node_sentinel "https://github.com/architaggarwal24/friday/blob/main/sentinel/core.py"
click node_verifier "https://github.com/architaggarwal24/friday/blob/main/verifier/core.py"
click node_memory "https://github.com/architaggarwal24/friday/blob/main/memory/long_term.py"
click node_memory_store "https://github.com/architaggarwal24/friday/blob/main/memory/memory_store.py"
click node_graph_export "https://github.com/architaggarwal24/friday/blob/main/memory/graph_export.py"
click node_tts "https://github.com/architaggarwal24/friday/blob/main/voice/tts.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_ui,node_ws,node_user toneBlue
class node_backend,node_llm,node_model_router,node_handlers,node_planner,node_task_queue,node_executor toneAmber
class node_desktop_actions,node_file_actions,node_productivity,node_gmail,node_calendar,node_google_auth,node_google toneMint
class node_sentinel,node_verifier,node_memory,node_memory_store,node_graph_export toneRose
class node_voice_input,node_vad_stt,node_tts,node_llm_services toneIndigo
```

## Components

### Input and UI

- [Electron HUD](https://github.com/architaggarwal24/friday/blob/main/ui/renderer/App.jsx): `ui/renderer/App.jsx`
- [WebSocket bridge](https://github.com/architaggarwal24/friday/blob/main/ui/ws_server.py): `ui/ws_server.py`

### Assistant orchestration

- [Backend entry](https://github.com/architaggarwal24/friday/blob/main/main.py): `main.py`
- [LLM and tools](https://github.com/architaggarwal24/friday/blob/main/brain/llm.py): `brain/llm.py`
- [Model routing](https://github.com/architaggarwal24/friday/blob/main/brain/model_router.py): `brain/model_router.py`
- [Intent handlers](https://github.com/architaggarwal24/friday/blob/main/brain/handlers.py): `brain/handlers.py`
- [Task planner](https://github.com/architaggarwal24/friday/blob/main/agent/planner.py): `agent/planner.py`
- [Task queue](https://github.com/architaggarwal24/friday/blob/main/agent/task_queue.py): `agent/task_queue.py`
- [Task executor](https://github.com/architaggarwal24/friday/blob/main/agent/executor.py): `agent/executor.py`

### Actions and integrations

- [Desktop and browser](https://github.com/architaggarwal24/friday/tree/main/actions): `actions`
- [File operations](https://github.com/architaggarwal24/friday/tree/main/actions): `actions`
- [Productivity tools](https://github.com/architaggarwal24/friday/tree/main/actions): `actions`
- [Gmail](https://github.com/architaggarwal24/friday/blob/main/actions/gmail.py): `actions/gmail.py`
- [Calendar](https://github.com/architaggarwal24/friday/blob/main/actions/calendar.py): `actions/calendar.py`
- [Google OAuth](https://github.com/architaggarwal24/friday/blob/main/actions/google_auth.py): `actions/google_auth.py`

### Memory and safety

- [Risk classification](https://github.com/architaggarwal24/friday/blob/main/sentinel/core.py): `sentinel/core.py`
- [Action verification](https://github.com/architaggarwal24/friday/blob/main/verifier/core.py): `verifier/core.py`
- [Long-term vault](https://github.com/architaggarwal24/friday/blob/main/memory/long_term.py): `memory/long_term.py`
- [Encrypted local memory](https://github.com/architaggarwal24/friday/blob/main/memory/memory_store.py): `memory/memory_store.py`
- [Memory graph](https://github.com/architaggarwal24/friday/blob/main/memory/graph_export.py): `memory/graph_export.py`

### Voice pipeline

- [Voice input](https://github.com/architaggarwal24/friday/blob/main/voice/wake.py): `voice/wake.py`
- [VAD and STT](https://github.com/architaggarwal24/friday/blob/main/voice/stt.py): `voice/stt.py`
- [Speech output](https://github.com/architaggarwal24/friday/blob/main/voice/tts.py): `voice/tts.py`

### Other components

- **User**
- **LLM providers**
- **Google APIs**

## Connections

- User → Voice input: speaks
- Voice input → VAD and STT: captures speech
- Backend entry → VAD and STT: initializes (evidence: `main.py`)
- Backend entry → Voice input: initializes (evidence: `main.py`)
- User → Electron HUD: uses
- Electron HUD → WebSocket bridge: bridges commands
- Backend entry → WebSocket bridge: starts (evidence: `main.py`)
- WebSocket bridge → LLM and tools: routes UI input (evidence: `ui/ws_server.py`)
- VAD and STT → LLM and tools: provides transcript
- Backend entry → LLM and tools: starts assistant (evidence: `main.py`)
- LLM and tools → Model routing: selects provider (evidence: `brain/model_router.py`)
- Model routing → LLM providers: dispatches requests
- LLM and tools → Intent handlers: dispatches tools (evidence: `brain/llm.py`)
- LLM and tools → Task planner: plans tasks (evidence: `brain/llm.py`)
- LLM and tools → Task queue: submits tasks (evidence: `brain/llm.py`)
- Task queue → Task planner: requests plan (evidence: `agent/task_queue.py`)
- Task queue → Task executor: dispatches tasks (evidence: `agent/task_queue.py`)
- Intent handlers → Desktop and browser: invokes tools (evidence: `brain/handlers.py`)
- Intent handlers → File operations: invokes tools (evidence: `brain/handlers.py`)
- Intent handlers → Productivity tools: invokes tools (evidence: `brain/handlers.py`)
- Intent handlers → Gmail: invokes Gmail (evidence: `brain/handlers.py`)
- Intent handlers → Calendar: invokes calendar (evidence: `brain/handlers.py`)
- Gmail → Google OAuth: gets credentials (evidence: `actions/gmail.py`)
- Calendar → Google OAuth: gets credentials (evidence: `actions/calendar.py`)
- Google OAuth → Google APIs: authorizes API access
- LLM and tools → Risk classification: checks action risk (evidence: `brain/llm.py`)
- LLM and tools → Action verification: verifies results (evidence: `brain/llm.py`)
- LLM and tools → Long-term vault: reads and writes (evidence: `brain/llm.py`)
- LLM and tools → Encrypted local memory: stores conversation data (evidence: `brain/llm.py`)
- Encrypted local memory → Long-term vault: uses vault memory (evidence: `memory/memory_store.py`)
- Long-term vault → Memory graph: exports graph (evidence: `memory/long_term.py`)
- LLM and tools → Speech output: streams speech (evidence: `brain/llm.py`)
- Speech output → WebSocket bridge: reports audio state (evidence: `voice/tts.py`)
