# fatihmakes/mark-xlix architecture

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

- Interactive diagram: https://gitdiagram.com/fatihmakes/mark-xlix
- Repository: https://github.com/fatihmakes/mark-xlix

## Overview

#### Purpose and Entry Points
MARK XLIX is a cross-platform, local personal AI assistant centered on low-latency Gemini Live voice interaction, computer control, visual context, and persistent personalization. `main.py` is the runtime orchestrator for the Gemini session, audio I/O, and tool dispatch. `ui.py` hosts the desktop HUD and interaction controls; `setup.py` handles first-run setup.

#### Session and LLM Core
The live assistant loop connects user input, Gemini reasoning/tool calls, and spoken or UI output. LLM integration, speech recognition, and speech synthesis are separated under `core/`, while the assistant behavior and routing policy are defined in `core/prompt.txt`.
- `main.py`
- `core/llm_client.py`
- `core/stt.py`
- `core/tts.py`

#### Desktop UI and Remote Surface
The primary UI is a PyQt6 HUD with waveform, activity log, interruption controls, camera/display elements, settings, and dynamic content presentation. A separate dashboard server exposes a browser-based remote-control surface, with TLS material present for secure hosting/pairing.
- `ui.py`
- `dashboard/server.py`
- `dashboard/static/app.html`
- `config/certs/jarvis.crt`

#### Tool/Action Boundary
The model-facing capability boundary is the `actions/` package: `main.py` dispatches interpreted requests to focused adapters that execute OS operations or call external services. This is the primary safety and platform-integration boundary: actions can manipulate the desktop, applications, browser, files, messaging, and scheduled reminders.
- `actions/computer_control.py`
- `actions/computer_settings.py`
- `actions/open_app.py`

#### Computer Awareness and Automation
Visual and system-awareness actions feed screen/webcam context and hardware telemetry into the assistant workflow. Autonomous developer work and proactive suggestions extend the reactive command loop into multi-step or idle-time behavior.
- `actions/screen_processor.py`
- `actions/system_monitor.py`
- `actions/dev_agent.py`
- `actions/proactive.py`

#### Information and External-Service Actions
Information retrieval uses Gemini-grounded search with DuckDuckGo fallback; specialized actions provide weather, flights, YouTube, game platform, and messaging integrations. These modules isolate service-specific protocols from the main live session.
- `actions/web_search.py`
- `actions/weather_report.py`
- `actions/flight_finder.py`
- `actions/send_message.py`

#### Persistence, Setup, and OS Integration
Persistent memory stores user preferences, context, language, and personalization independently of the active conversation. Configuration management supports assistant/user naming and runtime settings. Installation/setup also handles OS-specific boot registration and native scheduling mechanisms, spanning Windows, macOS, and Linux.
- `memory/memory_manager.py`
- `memory/config_manager.py`
- `core/installer.py`
- `setup.py`

#### Runtime Dependencies and Infrastructure
The application runs on Python 3.11/3.12 with microphone and OS automation dependencies, requiring a Gemini API key. Core external dependencies include Gemini Live/API services, OS-native desktop APIs and schedulers, web search providers, and optional Steam/Epic, browser, messaging, weather, and flight services. Package dependencies are declared in `requirements.txt`.

Main entry points: [`main.py`](https://github.com/fatihmakes/mark-xlix/blob/main/main.py) (Runtime orchestrator), [`actions/web_search.py`](https://github.com/fatihmakes/mark-xlix/blob/main/actions/web_search.py) (Information services), [`core/llm_client.py`](https://github.com/fatihmakes/mark-xlix/blob/main/core/llm_client.py) (Gemini Live client), [`ui.py`](https://github.com/fatihmakes/mark-xlix/blob/main/ui.py) (Desktop HUD)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry &amp; Surfaces"]
  node_main["Runtime orchestrator<br/>Python entry point<br/>[main.py]"]
  node_hud["Desktop HUD<br/>PyQt6 UI<br/>[ui.py]"]
  node_dashboard["Remote dashboard<br/>dashboard server<br/>[server.py]"]
  node_dashboard_client["Dashboard client<br/>browser UI<br/>[app.html]"]
end

subgraph group_core["Live Assistant Core"]
  node_llm["Gemini Live client<br/>LLM integration<br/>[llm_client.py]"]
  node_prompt["Assistant policy<br/>prompt<br/>[prompt.txt]"]
  node_stt["Speech recognition<br/>audio input<br/>[stt.py]"]
  node_tts["Speech synthesis<br/>audio output<br/>[tts.py]"]
end

subgraph group_actions["Actions &amp; Automation"]
  node_desktop_actions["Desktop controls<br/>action adapters"]
  node_awareness["Visual &amp; system awareness<br/>context actions"]
  node_automation["Proactive automation<br/>agent actions<br/>[dev_agent.py]"]
  node_information["Information services<br/>service actions<br/>[web_search.py]"]
end

subgraph group_state["Persistence &amp; Setup"]
  node_memory[("Personal memory<br/>memory manager<br/>[memory_manager.py]")]
  node_config[("Runtime configuration<br/>config manager<br/>[config_manager.py]")]
  node_setup["First-run setup<br/>setup entry point<br/>[setup.py]"]
  node_installer["OS installer<br/>installation service<br/>[installer.py]"]
end

node_gemini{{"Gemini API / Live<br/>external AI service"}}
node_os_services{{"Desktop OS &amp; services<br/>external platform"}}
node_requirements["Python dependencies<br/>dependency manifest<br/>[requirements.txt]"]

node_hud -->|"user controls"| node_main
node_dashboard_client -->|"remote control"| node_dashboard
node_dashboard -->|"session commands"| node_main
node_stt -->|"transcript"| node_main
node_main -->|"live requests"| node_llm
node_llm -->|"Live API"| node_gemini
node_prompt -->|"behavior policy"| node_llm
node_main -->|"spoken responses"| node_tts
node_tts -.->|"assistant activity"| node_hud
node_main -->|"tool dispatch"| node_desktop_actions
node_main -->|"context requests"| node_awareness
node_main -->|"agent tasks"| node_automation
node_main -->|"service requests"| node_information
node_desktop_actions -->|"desktop operations"| node_os_services
node_awareness -->|"screen and telemetry"| node_os_services
node_automation -->|"automation"| node_os_services
node_information -.->|"grounded search"| node_gemini
node_information -->|"external providers"| node_os_services
node_main -->|"personal context"| node_memory
node_main -->|"runtime settings"| node_config
node_setup -->|"installation"| node_installer
node_installer -->|"boot and scheduling"| node_os_services
node_requirements -.->|"runtime packages"| node_main

click node_main "https://github.com/fatihmakes/mark-xlix/blob/main/main.py"
click node_hud "https://github.com/fatihmakes/mark-xlix/blob/main/ui.py"
click node_dashboard "https://github.com/fatihmakes/mark-xlix/blob/main/dashboard/server.py"
click node_dashboard_client "https://github.com/fatihmakes/mark-xlix/blob/main/dashboard/static/app.html"
click node_llm "https://github.com/fatihmakes/mark-xlix/blob/main/core/llm_client.py"
click node_prompt "https://github.com/fatihmakes/mark-xlix/blob/main/core/prompt.txt"
click node_stt "https://github.com/fatihmakes/mark-xlix/blob/main/core/stt.py"
click node_tts "https://github.com/fatihmakes/mark-xlix/blob/main/core/tts.py"
click node_desktop_actions "https://github.com/fatihmakes/mark-xlix/blob/main/actions/computer_control.py"
click node_awareness "https://github.com/fatihmakes/mark-xlix/blob/main/actions/screen_processor.py"
click node_automation "https://github.com/fatihmakes/mark-xlix/blob/main/actions/dev_agent.py"
click node_information "https://github.com/fatihmakes/mark-xlix/blob/main/actions/web_search.py"
click node_memory "https://github.com/fatihmakes/mark-xlix/blob/main/memory/memory_manager.py"
click node_config "https://github.com/fatihmakes/mark-xlix/blob/main/memory/config_manager.py"
click node_setup "https://github.com/fatihmakes/mark-xlix/blob/main/setup.py"
click node_installer "https://github.com/fatihmakes/mark-xlix/blob/main/core/installer.py"
click node_requirements "https://github.com/fatihmakes/mark-xlix/blob/main/requirements.txt"

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_main,node_hud,node_dashboard,node_dashboard_client toneBlue
class node_llm,node_prompt,node_stt,node_tts toneAmber
class node_desktop_actions,node_awareness,node_automation,node_information toneMint
class node_memory,node_config,node_setup,node_installer toneRose
class node_gemini,node_os_services,node_requirements toneNeutral
```

## Components

### Entry & Surfaces

- [Runtime orchestrator](https://github.com/fatihmakes/mark-xlix/blob/main/main.py): Python entry point · Runs the live session, audio I/O, and tool dispatch. · `main.py`
- [Desktop HUD](https://github.com/fatihmakes/mark-xlix/blob/main/ui.py): PyQt6 UI · Voice interaction, visual context, controls, and activity display. · `ui.py`
- [Remote dashboard](https://github.com/fatihmakes/mark-xlix/blob/main/dashboard/server.py): dashboard server · Browser-based remote control surface. · `dashboard/server.py`
- [Dashboard client](https://github.com/fatihmakes/mark-xlix/blob/main/dashboard/static/app.html): browser UI · `dashboard/static/app.html`

### Live Assistant Core

- [Gemini Live client](https://github.com/fatihmakes/mark-xlix/blob/main/core/llm_client.py): LLM integration · Connects the session to Gemini reasoning and tool calls. · `core/llm_client.py`
- [Assistant policy](https://github.com/fatihmakes/mark-xlix/blob/main/core/prompt.txt): prompt · Defines assistant behavior and routing policy. · `core/prompt.txt`
- [Speech recognition](https://github.com/fatihmakes/mark-xlix/blob/main/core/stt.py): audio input · `core/stt.py`
- [Speech synthesis](https://github.com/fatihmakes/mark-xlix/blob/main/core/tts.py): audio output · `core/tts.py`

### Actions & Automation

Model-facing capability and platform boundary.

- [Desktop controls](https://github.com/fatihmakes/mark-xlix/blob/main/actions/computer_control.py): action adapters · Computer control, settings, and application launching. · `actions/computer_control.py`
- [Visual & system awareness](https://github.com/fatihmakes/mark-xlix/blob/main/actions/screen_processor.py): context actions · Captures screen context and system telemetry. · `actions/screen_processor.py`
- [Proactive automation](https://github.com/fatihmakes/mark-xlix/blob/main/actions/dev_agent.py): agent actions · Runs developer tasks and idle-time suggestions. · `actions/dev_agent.py`
- [Information services](https://github.com/fatihmakes/mark-xlix/blob/main/actions/web_search.py): service actions · Search and specialized external-service requests. · `actions/web_search.py`

### Persistence & Setup

- [Personal memory](https://github.com/fatihmakes/mark-xlix/blob/main/memory/memory_manager.py): memory manager · Persists preferences, context, language, and personalization. · `memory/memory_manager.py`
- [Runtime configuration](https://github.com/fatihmakes/mark-xlix/blob/main/memory/config_manager.py): config manager · Stores assistant identity and runtime settings. · `memory/config_manager.py`
- [First-run setup](https://github.com/fatihmakes/mark-xlix/blob/main/setup.py): setup entry point · Initializes installation and OS integration. · `setup.py`
- [OS installer](https://github.com/fatihmakes/mark-xlix/blob/main/core/installer.py): installation service · Registers platform-specific boot and scheduling integration. · `core/installer.py`

### Other components

- **Gemini API / Live**: external AI service
- **Desktop OS & services**: external platform · Native desktop APIs, apps, schedulers, and service integrations.
- [Python dependencies](https://github.com/fatihmakes/mark-xlix/blob/main/requirements.txt): dependency manifest · `requirements.txt`

## Connections

- Desktop HUD → Runtime orchestrator: user controls
- Dashboard client → Remote dashboard: remote control
- Remote dashboard → Runtime orchestrator: session commands
- Speech recognition → Runtime orchestrator: transcript
- Runtime orchestrator → Gemini Live client: live requests
- Gemini Live client → Gemini API / Live: Live API
- Assistant policy → Gemini Live client: behavior policy
- Runtime orchestrator → Speech synthesis: spoken responses
- Speech synthesis → Desktop HUD: assistant activity
- Runtime orchestrator → Desktop controls: tool dispatch
- Runtime orchestrator → Visual & system awareness: context requests
- Runtime orchestrator → Proactive automation: agent tasks
- Runtime orchestrator → Information services: service requests
- Desktop controls → Desktop OS & services: desktop operations
- Visual & system awareness → Desktop OS & services: screen and telemetry
- Proactive automation → Desktop OS & services: automation
- Information services → Gemini API / Live: grounded search
- Information services → Desktop OS & services: external providers
- Runtime orchestrator → Personal memory: personal context
- Runtime orchestrator → Runtime configuration: runtime settings
- First-run setup → OS installer: installation
- OS installer → Desktop OS & services: boot and scheduling
- Python dependencies → Runtime orchestrator: runtime packages
