# saksham-garg2008/desk architecture

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

## Overview

DESK is a native desktop AI-office app: users create or configure agents, select a model backend, chat with agents, and retain conversation history and distilled memory. Agent responses can become versioned workspace artifacts, which users browse and inspect. The graph emphasizes these domain stages and the UI/runtime orchestration. Most links are supported by README statements or indexed imports; unsampled UI and peripheral modules are represented only where documented, so some detailed runtime wiring is omitted.

Main entry points: [`ui/panels/chat_panel.py`](https://github.com/saksham-garg2008/desk/blob/main/ui/panels/chat_panel.py) (Agent chat), [`ui/main_window.py`](https://github.com/saksham-garg2008/desk/blob/main/ui/main_window.py) (Main window), [`core/inference_manager.py`](https://github.com/saksham-garg2008/desk/blob/main/core/inference_manager.py) (Inference gateway), [`core/artifact_manager.py`](https://github.com/saksham-garg2008/desk/blob/main/core/artifact_manager.py) (Artifact manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Desktop experience"]
  node_window["Main window<br/>[main_window.py]"]
  node_chat["Agent chat<br/>[chat_panel.py]"]
  node_workspace_ui["Workspace browser<br/>[workspace_panel.py]"]
  node_inspector["Code inspector"]
  node_memory_ui["Memory panel<br/>[memory_panel.py]"]
end

subgraph group_agents["Agent management"]
  node_agent_dialog["Create agent"]
  node_edit_dialog["Edit agent"]
  node_agent_files["Agent prompts"]
end

subgraph group_runtime["Conversation runtime"]
  node_compute["Compute manager<br/>[compute_manager.py]"]
  node_inference["Inference gateway"]
end

subgraph group_knowledge["Persistent workspace"]
  node_history[("Chat history<br/>[history_manager.py]")]
  node_memory[("Long-term memory<br/>[memory_manager.py]")]
  node_artifacts["Artifact manager"]
  node_artifact_store[("Versioned artifacts")]
end

subgraph group_settings["Configuration"]
  node_agent_config[("Agent configuration<br/>[agents.json]")]
  node_config_loader["Config loader<br/>[config_loader.py]"]
  node_app_config[("App and model settings")]
  node_paths["Data paths<br/>[paths.py]"]
  node_keys["API keys<br/>[keys_panel.py]"]
end

node_user(("Desktop user"))
node_providers{{"LLM providers"}}

node_user -->|"uses"| node_window
node_window -->|"shows"| node_chat
node_window -->|"opens"| node_workspace_ui
node_window -->|"opens"| node_inspector
node_window -->|"shows"| node_memory_ui
node_user -->|"creates"| node_agent_dialog
node_agent_dialog -->|"configures"| node_agent_config
node_agent_dialog -->|"writes prompt"| node_agent_files
node_user -->|"edits"| node_edit_dialog
node_edit_dialog -->|"updates"| node_agent_config
node_edit_dialog -->|"updates prompt"| node_agent_files
node_chat -->|"dispatches"| node_compute
node_compute -->|"runs worker"| node_inference
node_inference -->|"streams requests"| node_providers
node_chat -->|"saves chat"| node_history
node_chat -->|"parses response"| node_artifacts
node_artifacts -->|"persists versions"| node_artifact_store
node_workspace_ui -->|"lists files"| node_artifacts
node_inspector -->|"reads versions"| node_artifacts
node_chat -->|"distills exchanges"| node_memory
node_memory_ui -->|"views and edits"| node_memory
node_memory_ui -->|"regenerates memory"| node_inference
node_config_loader -->|"reads and writes"| node_app_config
node_config_loader -->|"uses paths"| node_paths
node_keys -->|"stores keys"| node_config_loader
node_inference -->|"loads provider config"| node_config_loader
node_history -->|"uses paths"| node_paths
node_memory -->|"uses paths"| node_paths
node_artifacts -->|"uses paths"| node_paths
node_chat -->|"requests response"| node_inference

click node_window "https://github.com/saksham-garg2008/desk/blob/main/ui/main_window.py"
click node_chat "https://github.com/saksham-garg2008/desk/blob/main/ui/panels/chat_panel.py"
click node_workspace_ui "https://github.com/saksham-garg2008/desk/blob/main/ui/panels/workspace_panel.py"
click node_inspector "https://github.com/saksham-garg2008/desk/blob/main/ui/panels/code_inspector_panel.py"
click node_memory_ui "https://github.com/saksham-garg2008/desk/blob/main/ui/panels/memory_panel.py"
click node_agent_dialog "https://github.com/saksham-garg2008/desk/blob/main/ui/dialogs/add_agent_dialog.py"
click node_edit_dialog "https://github.com/saksham-garg2008/desk/blob/main/ui/dialogs/edit_agent_dialog.py"
click node_agent_files "https://github.com/saksham-garg2008/desk/tree/main/bucket"
click node_agent_config "https://github.com/saksham-garg2008/desk/blob/main/config/agents.json"
click node_compute "https://github.com/saksham-garg2008/desk/blob/main/core/compute_manager.py"
click node_inference "https://github.com/saksham-garg2008/desk/blob/main/core/inference_manager.py"
click node_history "https://github.com/saksham-garg2008/desk/blob/main/core/history_manager.py"
click node_memory "https://github.com/saksham-garg2008/desk/blob/main/core/memory_manager.py"
click node_artifacts "https://github.com/saksham-garg2008/desk/blob/main/core/artifact_manager.py"
click node_artifact_store "https://github.com/saksham-garg2008/desk/tree/main/workspace"
click node_config_loader "https://github.com/saksham-garg2008/desk/blob/main/core/config_loader.py"
click node_app_config "https://github.com/saksham-garg2008/desk/tree/main/config"
click node_paths "https://github.com/saksham-garg2008/desk/blob/main/core/paths.py"
click node_keys "https://github.com/saksham-garg2008/desk/blob/main/ui/panels/keys_panel.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_window,node_chat,node_workspace_ui,node_inspector,node_memory_ui,node_user toneBlue
class node_agent_dialog,node_edit_dialog,node_agent_files toneAmber
class node_compute,node_inference toneMint
class node_history,node_memory,node_artifacts,node_artifact_store toneRose
class node_agent_config,node_config_loader,node_app_config,node_paths,node_keys,node_providers toneIndigo
```

## Components

### Desktop experience

- [Main window](https://github.com/saksham-garg2008/desk/blob/main/ui/main_window.py): `ui/main_window.py`
- [Agent chat](https://github.com/saksham-garg2008/desk/blob/main/ui/panels/chat_panel.py): `ui/panels/chat_panel.py`
- [Workspace browser](https://github.com/saksham-garg2008/desk/blob/main/ui/panels/workspace_panel.py): `ui/panels/workspace_panel.py`
- [Code inspector](https://github.com/saksham-garg2008/desk/blob/main/ui/panels/code_inspector_panel.py): `ui/panels/code_inspector_panel.py`
- [Memory panel](https://github.com/saksham-garg2008/desk/blob/main/ui/panels/memory_panel.py): `ui/panels/memory_panel.py`

### Agent management

- [Create agent](https://github.com/saksham-garg2008/desk/blob/main/ui/dialogs/add_agent_dialog.py): `ui/dialogs/add_agent_dialog.py`
- [Edit agent](https://github.com/saksham-garg2008/desk/blob/main/ui/dialogs/edit_agent_dialog.py): `ui/dialogs/edit_agent_dialog.py`
- [Agent prompts](https://github.com/saksham-garg2008/desk/tree/main/bucket): `bucket`

### Conversation runtime

- [Compute manager](https://github.com/saksham-garg2008/desk/blob/main/core/compute_manager.py): `core/compute_manager.py`
- [Inference gateway](https://github.com/saksham-garg2008/desk/blob/main/core/inference_manager.py): `core/inference_manager.py`

### Persistent workspace

- [Chat history](https://github.com/saksham-garg2008/desk/blob/main/core/history_manager.py): `core/history_manager.py`
- [Long-term memory](https://github.com/saksham-garg2008/desk/blob/main/core/memory_manager.py): `core/memory_manager.py`
- [Artifact manager](https://github.com/saksham-garg2008/desk/blob/main/core/artifact_manager.py): `core/artifact_manager.py`
- [Versioned artifacts](https://github.com/saksham-garg2008/desk/tree/main/workspace): `workspace`

### Configuration

- [Agent configuration](https://github.com/saksham-garg2008/desk/blob/main/config/agents.json): `config/agents.json`
- [Config loader](https://github.com/saksham-garg2008/desk/blob/main/core/config_loader.py): `core/config_loader.py`
- [App and model settings](https://github.com/saksham-garg2008/desk/tree/main/config): `config`
- [Data paths](https://github.com/saksham-garg2008/desk/blob/main/core/paths.py): `core/paths.py`
- [API keys](https://github.com/saksham-garg2008/desk/blob/main/ui/panels/keys_panel.py): `ui/panels/keys_panel.py`

### Other components

- **Desktop user**
- **LLM providers**

## Connections

- Desktop user → Main window: uses (evidence: `README.md`)
- Main window → Agent chat: shows (evidence: `ui/main_window.py`)
- Main window → Workspace browser: opens (evidence: `ui/main_window.py`)
- Main window → Code inspector: opens (evidence: `ui/main_window.py`)
- Main window → Memory panel: shows (evidence: `ui/main_window.py`)
- Desktop user → Create agent: creates (evidence: `README.md`)
- Create agent → Agent configuration: configures (evidence: `ui/dialogs/add_agent_dialog.py`)
- Create agent → Agent prompts: writes prompt (evidence: `README.md`)
- Desktop user → Edit agent: edits (evidence: `README.md`)
- Edit agent → Agent configuration: updates (evidence: `ui/dialogs/edit_agent_dialog.py`)
- Edit agent → Agent prompts: updates prompt (evidence: `ui/dialogs/edit_agent_dialog.py`)
- Agent chat → Compute manager: dispatches (evidence: `ui/panels/chat_panel.py`)
- Compute manager → Inference gateway: runs worker (evidence: `core/compute_manager.py`)
- Inference gateway → LLM providers: streams requests (evidence: `README.md`)
- Agent chat → Chat history: saves chat (evidence: `ui/panels/chat_panel.py`)
- Agent chat → Artifact manager: parses response (evidence: `ui/panels/chat_panel.py`)
- Artifact manager → Versioned artifacts: persists versions (evidence: `README.md`)
- Workspace browser → Artifact manager: lists files (evidence: `ui/panels/workspace_panel.py`)
- Code inspector → Artifact manager: reads versions (evidence: `ui/panels/code_inspector_panel.py`)
- Agent chat → Long-term memory: distills exchanges (evidence: `ui/panels/chat_panel.py`)
- Memory panel → Long-term memory: views and edits (evidence: `ui/panels/memory_panel.py`)
- Memory panel → Inference gateway: regenerates memory (evidence: `ui/panels/memory_panel.py`)
- Config loader → App and model settings: reads and writes (evidence: `core/config_loader.py`)
- Config loader → Data paths: uses paths (evidence: `core/config_loader.py`)
- API keys → Config loader: stores keys (evidence: `ui/panels/keys_panel.py`)
- Inference gateway → Config loader: loads provider config (evidence: `core/inference_manager.py`)
- Chat history → Data paths: uses paths (evidence: `core/history_manager.py`)
- Long-term memory → Data paths: uses paths (evidence: `core/memory_manager.py`)
- Artifact manager → Data paths: uses paths (evidence: `core/artifact_manager.py`)
- Agent chat → Inference gateway: requests response (evidence: `ui/panels/chat_panel.py`)
