# christyl753/alyx architecture

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

- Interactive diagram: https://gitdiagram.com/christyl753/alyx
- Repository: https://github.com/christyl753/alyx

## Overview

Alyx is a local desktop assistant: a user opens its floating-orb panel, chats or selects a capability, and receives a response or system action. The desktop communicates with a Python backend over a local WebSocket; the backend coordinates model requests and available tools. Distinct capabilities include conversation context, voice, files, reminders/notes, system monitoring and control, media, model management, and quick settings. Some subsystem links are documented rather than visible in the excerpts, so those edges cite the README; unsampled implementation details are not inferred.

Main entry points: [`ai.py`](https://github.com/christyl753/alyx/blob/main/ai.py) (Tool-using assistant), [`AlyxDesktop/AlyxPanel.axaml.cs`](https://github.com/christyl753/alyx/blob/main/AlyxDesktop/AlyxPanel.axaml.cs) (Assistant panel), [`api.py`](https://github.com/christyl753/alyx/blob/main/api.py) (WebSocket API), [`AlyxDesktop/Services/BackendClient.cs`](https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Services/BackendClient.cs) (Backend client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop interface"]
  node_orb(("Floating orb<br/>[AlyxEye.cs]"))
  node_panel["Assistant panel<br/>[AlyxPanel.axaml.cs]"]
  node_widget["Widget window"]
  node_client["Backend client<br/>[BackendClient.cs]"]
end

subgraph group_backend["Assistant backend"]
  node_api["WebSocket API<br/>[api.py]"]
  node_assistant["Tool-using assistant<br/>[ai.py]"]
end

subgraph group_conversation["Conversation and models"]
  node_context["Invocation context<br/>[context.py]"]
  node_history[("Conversation history<br/>[history.py]")]
  node_provider["Model providers<br/>[llm_provider.py]"]
end

subgraph group_capabilities["Assistant capabilities"]
  node_monitor["System monitoring<br/>[system_monitor.py]"]
  node_system["System actions<br/>[system.py]"]
  node_files["File operations<br/>[files.py]"]
  node_reminders[("Reminders<br/>[reminders.py]")]
  node_notes[("Notes<br/>[notes.py]")]
  node_voice["Voice input<br/>[voice.py]"]
  node_speech["Speech output<br/>[tts.py]"]
end

subgraph group_platform["Platform controls"]
  node_media["Media control<br/>[MediaService.cs]"]
  node_quick["Quick settings"]
  node_audio["Volume control<br/>[AudioService.cs]"]
  node_brightness["Brightness control"]
  node_startup["Startup setting<br/>[StartupService.cs]"]
  node_shell["OS command helper<br/>[Shell.cs]"]
end

node_user(("User"))
node_local_engine["Local model engine"]
node_microphone(("Microphone"))

node_user -->|"opens"| node_orb
node_orb -->|"opens panel"| node_panel
node_panel -->|"sends requests"| node_client
node_widget -->|"uses"| node_client
node_client -->|"WebSocket messages"| node_api
node_api -->|"dispatches chat"| node_assistant
node_assistant -->|"requests completion"| node_provider
node_provider -.->|"queries models"| node_local_engine
node_assistant -->|"enriches prompt"| node_context
node_api -->|"manages history"| node_history
node_assistant -->|"invokes tools"| node_files
node_assistant -->|"invokes tools"| node_system
node_assistant -->|"invokes tools"| node_reminders
node_assistant -->|"invokes tools"| node_notes
node_assistant -->|"uses monitoring"| node_monitor
node_api -.->|"handles voice input"| node_voice
node_api -.->|"provides speech"| node_speech
node_microphone -.->|"captures audio"| node_voice
node_panel -->|"controls playback"| node_media
node_panel -->|"changes toggles"| node_quick
node_panel -->|"sets volume"| node_audio
node_panel -->|"sets brightness"| node_brightness
node_panel -->|"sets startup"| node_startup
node_quick -->|"runs commands"| node_shell
node_media -->|"runs commands"| node_shell
node_audio -->|"runs commands"| node_shell
node_system -->|"reads metrics"| node_monitor

click node_orb "https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Controls/AlyxEye.cs"
click node_panel "https://github.com/christyl753/alyx/blob/main/AlyxDesktop/AlyxPanel.axaml.cs"
click node_widget "https://github.com/christyl753/alyx/blob/main/AlyxDesktop/WidgetWindow.axaml.cs"
click node_client "https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Services/BackendClient.cs"
click node_api "https://github.com/christyl753/alyx/blob/main/api.py"
click node_assistant "https://github.com/christyl753/alyx/blob/main/ai.py"
click node_context "https://github.com/christyl753/alyx/blob/main/core/context.py"
click node_history "https://github.com/christyl753/alyx/blob/main/core/history.py"
click node_provider "https://github.com/christyl753/alyx/blob/main/core/llm_provider.py"
click node_monitor "https://github.com/christyl753/alyx/blob/main/core/system_monitor.py"
click node_system "https://github.com/christyl753/alyx/blob/main/function/system.py"
click node_files "https://github.com/christyl753/alyx/blob/main/function/files.py"
click node_reminders "https://github.com/christyl753/alyx/blob/main/function/reminders.py"
click node_notes "https://github.com/christyl753/alyx/blob/main/function/notes.py"
click node_voice "https://github.com/christyl753/alyx/blob/main/function/voice.py"
click node_speech "https://github.com/christyl753/alyx/blob/main/function/tts.py"
click node_media "https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Platform/MediaService.cs"
click node_quick "https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Platform/QuickSettingsService.cs"
click node_audio "https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Platform/AudioService.cs"
click node_brightness "https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Platform/BrightnessService.cs"
click node_startup "https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Platform/StartupService.cs"
click node_shell "https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Platform/Shell.cs"

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_orb,node_panel,node_widget,node_client,node_user toneBlue
class node_api,node_assistant toneAmber
class node_context,node_history,node_provider toneMint
class node_monitor,node_system,node_files,node_reminders,node_notes,node_voice,node_speech toneRose
class node_media,node_quick,node_audio,node_brightness,node_startup,node_shell,node_local_engine,node_microphone toneIndigo
```

## Components

### Desktop interface

- [Floating orb](https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Controls/AlyxEye.cs): `AlyxDesktop/Controls/AlyxEye.cs`
- [Assistant panel](https://github.com/christyl753/alyx/blob/main/AlyxDesktop/AlyxPanel.axaml.cs): `AlyxDesktop/AlyxPanel.axaml.cs`
- [Widget window](https://github.com/christyl753/alyx/blob/main/AlyxDesktop/WidgetWindow.axaml.cs): `AlyxDesktop/WidgetWindow.axaml.cs`
- [Backend client](https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Services/BackendClient.cs): `AlyxDesktop/Services/BackendClient.cs`

### Assistant backend

- [WebSocket API](https://github.com/christyl753/alyx/blob/main/api.py): `api.py`
- [Tool-using assistant](https://github.com/christyl753/alyx/blob/main/ai.py): `ai.py`

### Conversation and models

- [Invocation context](https://github.com/christyl753/alyx/blob/main/core/context.py): `core/context.py`
- [Conversation history](https://github.com/christyl753/alyx/blob/main/core/history.py): `core/history.py`
- [Model providers](https://github.com/christyl753/alyx/blob/main/core/llm_provider.py): `core/llm_provider.py`

### Assistant capabilities

- [System monitoring](https://github.com/christyl753/alyx/blob/main/core/system_monitor.py): `core/system_monitor.py`
- [System actions](https://github.com/christyl753/alyx/blob/main/function/system.py): `function/system.py`
- [File operations](https://github.com/christyl753/alyx/blob/main/function/files.py): `function/files.py`
- [Reminders](https://github.com/christyl753/alyx/blob/main/function/reminders.py): `function/reminders.py`
- [Notes](https://github.com/christyl753/alyx/blob/main/function/notes.py): `function/notes.py`
- [Voice input](https://github.com/christyl753/alyx/blob/main/function/voice.py): `function/voice.py`
- [Speech output](https://github.com/christyl753/alyx/blob/main/function/tts.py): `function/tts.py`

### Platform controls

- [Media control](https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Platform/MediaService.cs): `AlyxDesktop/Platform/MediaService.cs`
- [Quick settings](https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Platform/QuickSettingsService.cs): `AlyxDesktop/Platform/QuickSettingsService.cs`
- [Volume control](https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Platform/AudioService.cs): `AlyxDesktop/Platform/AudioService.cs`
- [Brightness control](https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Platform/BrightnessService.cs): `AlyxDesktop/Platform/BrightnessService.cs`
- [Startup setting](https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Platform/StartupService.cs): `AlyxDesktop/Platform/StartupService.cs`
- [OS command helper](https://github.com/christyl753/alyx/blob/main/AlyxDesktop/Platform/Shell.cs): `AlyxDesktop/Platform/Shell.cs`

### Other components

- **User**
- **Local model engine**
- **Microphone**

## Connections

- User → Floating orb: opens
- Floating orb → Assistant panel: opens panel
- Assistant panel → Backend client: sends requests (evidence: `AlyxDesktop/AlyxPanel.axaml.cs`)
- Widget window → Backend client: uses (evidence: `AlyxDesktop/WidgetWindow.axaml.cs`)
- Backend client → WebSocket API: WebSocket messages (evidence: `AlyxDesktop/Services/BackendClient.cs`)
- WebSocket API → Tool-using assistant: dispatches chat (evidence: `api.py`)
- Tool-using assistant → Model providers: requests completion (evidence: `ai.py`)
- Model providers → Local model engine: queries models
- Tool-using assistant → Invocation context: enriches prompt (evidence: `ai.py`)
- WebSocket API → Conversation history: manages history (evidence: `api.py`)
- Tool-using assistant → File operations: invokes tools (evidence: `ai.py`)
- Tool-using assistant → System actions: invokes tools
- Tool-using assistant → Reminders: invokes tools
- Tool-using assistant → Notes: invokes tools
- Tool-using assistant → System monitoring: uses monitoring (evidence: `core/system_monitor.py`)
- WebSocket API → Voice input: handles voice input
- WebSocket API → Speech output: provides speech (evidence: `api.py`)
- Microphone → Voice input: captures audio
- Assistant panel → Media control: controls playback (evidence: `AlyxDesktop/AlyxPanel.axaml.cs`)
- Assistant panel → Quick settings: changes toggles (evidence: `AlyxDesktop/AlyxPanel.axaml.cs`)
- Assistant panel → Volume control: sets volume (evidence: `AlyxDesktop/AlyxPanel.axaml.cs`)
- Assistant panel → Brightness control: sets brightness (evidence: `AlyxDesktop/AlyxPanel.axaml.cs`)
- Assistant panel → Startup setting: sets startup (evidence: `AlyxDesktop/AlyxPanel.axaml.cs`)
- Quick settings → OS command helper: runs commands (evidence: `AlyxDesktop/Platform/QuickSettingsService.cs`)
- Media control → OS command helper: runs commands (evidence: `AlyxDesktop/Platform/MediaService.cs`)
- Volume control → OS command helper: runs commands (evidence: `AlyxDesktop/Platform/AudioService.cs`)
- System actions → System monitoring: reads metrics (evidence: `function/system.py`)
