# ashish7802/ultron architecture

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

- Interactive diagram: https://gitdiagram.com/ashish7802/ultron
- Repository: https://github.com/ashish7802/ultron

## Overview

ULTRON is a local-first AI desktop assistant combining a Next.js interface with an Electron shell and Python desktop/voice capabilities. The main user workflow enters through the chat route, which evaluates and dispatches conversation, memory, system-control, local-model, and research requests; other UI/API branches expose memory, voice, screen awareness, and security features. Internal layers include cognitive reasoning, memory, research, screen intelligence, and permission controls. The graph follows README-described architecture and supplied source-index references; where implementation excerpts do not establish a connection, it omits the edge.

Main entry points: [`app/api/chat/route.ts`](https://github.com/ashish7802/ultron/blob/main/app/api/chat/route.ts) (Chat API), [`lib/memoryManager.ts`](https://github.com/ashish7802/ultron/blob/main/lib/memoryManager.ts) (Memory Manager), [`lib/screen/contextDeliveryEngine.ts`](https://github.com/ashish7802/ultron/blob/main/lib/screen/contextDeliveryEngine.ts) (Screen Intelligence), [`components/UltronWorkspace.tsx`](https://github.com/ashish7802/ultron/blob/main/components/UltronWorkspace.tsx) (Assistant UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["UI and Runtime"]
  node_ui["Assistant UI"]
  node_chatapi["Chat API<br/>[route.ts]"]
  node_electron["Electron Shell<br/>[main.js]"]
end

subgraph group_conversation["Assistant Workflow"]
  node_decision["Response Decision"]
  node_cognitive["Cognitive Engines"]
  node_localmodel["Local Model Client"]
end

subgraph group_capabilities["Desktop and Awareness"]
  node_system["System Control"]
  node_computer["Computer Tools<br/>[toolRegistry.ts]"]
  node_pythonbridge["Python Bridge<br/>[pythonBridge.ts]"]
  node_voice["Voice Runtime<br/>[server.py]"]
  node_screen["Screen Intelligence"]
  node_visioncontrol["Vision Control<br/>[visionControl.ts]"]
  node_temporal["Temporal Screen"]
end

subgraph group_state["Memory and Research"]
  node_memorymanager["Memory Manager<br/>[memoryManager.ts]"]
  node_memorycore["Memory Coordinator"]
  node_memoryvault[("Memory Vault")]
  node_researchapi["Research API<br/>[route.ts]"]
  node_research["Research Orchestrator<br/>[orchestrator.ts]"]
  node_researchrepo["Research Repository<br/>[repository.ts]"]
end

subgraph group_safety["Security and Privacy"]
  node_permissions["Permission Gateway"]
  node_permissionengine["Permission Engine"]
  node_paths["App Path Service<br/>[appPathService.ts]"]
  node_screenprivacy["Screen Privacy"]
end

node_user(("User"))
node_python["Local Python Services"]

node_user -->|"uses"| node_ui
node_ui -->|"sends requests"| node_chatapi
node_chatapi -->|"evaluates utterance"| node_decision
node_chatapi -->|"uses reasoning"| node_cognitive
node_chatapi -->|"invokes model"| node_localmodel
node_chatapi -->|"handles memory"| node_memorymanager
node_chatapi -->|"dispatches control"| node_system
node_chatapi -->|"runs research"| node_researchapi
node_researchapi -->|"invokes workflow"| node_research
node_memorymanager -->|"coordinates"| node_memorycore
node_memorymanager -->|"persists memory"| node_memoryvault
node_memorymanager -->|"resolves storage"| node_paths
node_research -->|"uses repository"| node_researchrepo
node_chatapi -->|"checks access"| node_permissions
node_permissions -.->|"enforces approvals"| node_permissionengine
node_system -.->|"requests desktop actions"| node_computer
node_computer -->|"bridges runtime"| node_pythonbridge
node_pythonbridge -.->|"calls local runtime"| node_python
node_ui -->|"runs inside"| node_electron
node_chatapi -->|"connects voice APIs"| node_voice
node_screen -->|"checks capture policy"| node_screenprivacy
node_screen -->|"uses vision control"| node_visioncontrol
node_screen -->|"uses temporal analysis"| node_temporal
node_electron -->|"starts local services"| node_python

click node_ui "https://github.com/ashish7802/ultron/blob/main/components/UltronWorkspace.tsx"
click node_chatapi "https://github.com/ashish7802/ultron/blob/main/app/api/chat/route.ts"
click node_electron "https://github.com/ashish7802/ultron/blob/main/electron/main.js"
click node_decision "https://github.com/ashish7802/ultron/blob/main/lib/responseDecisionEngine.ts"
click node_cognitive "https://github.com/ashish7802/ultron/tree/main/lib/cognitive"
click node_localmodel "https://github.com/ashish7802/ultron/blob/main/lib/cognitive/localModelClient.ts"
click node_system "https://github.com/ashish7802/ultron/blob/main/lib/systemController.ts"
click node_computer "https://github.com/ashish7802/ultron/blob/main/lib/computer/toolRegistry.ts"
click node_pythonbridge "https://github.com/ashish7802/ultron/blob/main/lib/computer/pythonBridge.ts"
click node_voice "https://github.com/ashish7802/ultron/blob/main/ultron_engine/server.py"
click node_screen "https://github.com/ashish7802/ultron/blob/main/lib/screen/contextDeliveryEngine.ts"
click node_visioncontrol "https://github.com/ashish7802/ultron/blob/main/lib/screen/visionControl.ts"
click node_temporal "https://github.com/ashish7802/ultron/blob/main/lib/screen/temporalScreenIntelligence.ts"
click node_memorymanager "https://github.com/ashish7802/ultron/blob/main/lib/memoryManager.ts"
click node_memorycore "https://github.com/ashish7802/ultron/blob/main/lib/memory/memoryCoordinator.ts"
click node_memoryvault "https://github.com/ashish7802/ultron/blob/main/ultron_memory_vault.json"
click node_researchapi "https://github.com/ashish7802/ultron/blob/main/app/api/research/route.ts"
click node_research "https://github.com/ashish7802/ultron/blob/main/lib/research/orchestrator.ts"
click node_researchrepo "https://github.com/ashish7802/ultron/blob/main/lib/research/repository.ts"
click node_permissions "https://github.com/ashish7802/ultron/blob/main/lib/permissionGateway.ts"
click node_permissionengine "https://github.com/ashish7802/ultron/blob/main/lib/security/permissionEngine.ts"
click node_paths "https://github.com/ashish7802/ultron/blob/main/lib/security/appPathService.ts"
click node_screenprivacy "https://github.com/ashish7802/ultron/blob/main/lib/screenPrivacyController.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_ui,node_chatapi,node_electron,node_user toneBlue
class node_decision,node_cognitive,node_localmodel toneAmber
class node_system,node_computer,node_pythonbridge,node_voice,node_screen,node_visioncontrol,node_temporal toneMint
class node_memorymanager,node_memorycore,node_memoryvault,node_researchapi,node_research,node_researchrepo toneRose
class node_permissions,node_permissionengine,node_paths,node_screenprivacy,node_python toneIndigo
```

## Components

### UI and Runtime

- [Assistant UI](https://github.com/ashish7802/ultron/blob/main/components/UltronWorkspace.tsx): `components/UltronWorkspace.tsx`
- [Chat API](https://github.com/ashish7802/ultron/blob/main/app/api/chat/route.ts): `app/api/chat/route.ts`
- [Electron Shell](https://github.com/ashish7802/ultron/blob/main/electron/main.js): `electron/main.js`

### Assistant Workflow

- [Response Decision](https://github.com/ashish7802/ultron/blob/main/lib/responseDecisionEngine.ts): `lib/responseDecisionEngine.ts`
- [Cognitive Engines](https://github.com/ashish7802/ultron/tree/main/lib/cognitive): `lib/cognitive`
- [Local Model Client](https://github.com/ashish7802/ultron/blob/main/lib/cognitive/localModelClient.ts): `lib/cognitive/localModelClient.ts`

### Desktop and Awareness

- [System Control](https://github.com/ashish7802/ultron/blob/main/lib/systemController.ts): `lib/systemController.ts`
- [Computer Tools](https://github.com/ashish7802/ultron/blob/main/lib/computer/toolRegistry.ts): `lib/computer/toolRegistry.ts`
- [Python Bridge](https://github.com/ashish7802/ultron/blob/main/lib/computer/pythonBridge.ts): `lib/computer/pythonBridge.ts`
- [Voice Runtime](https://github.com/ashish7802/ultron/blob/main/ultron_engine/server.py): `ultron_engine/server.py`
- [Screen Intelligence](https://github.com/ashish7802/ultron/blob/main/lib/screen/contextDeliveryEngine.ts): `lib/screen/contextDeliveryEngine.ts`
- [Vision Control](https://github.com/ashish7802/ultron/blob/main/lib/screen/visionControl.ts): `lib/screen/visionControl.ts`
- [Temporal Screen](https://github.com/ashish7802/ultron/blob/main/lib/screen/temporalScreenIntelligence.ts): `lib/screen/temporalScreenIntelligence.ts`

### Memory and Research

- [Memory Manager](https://github.com/ashish7802/ultron/blob/main/lib/memoryManager.ts): `lib/memoryManager.ts`
- [Memory Coordinator](https://github.com/ashish7802/ultron/blob/main/lib/memory/memoryCoordinator.ts): `lib/memory/memoryCoordinator.ts`
- [Memory Vault](https://github.com/ashish7802/ultron/blob/main/ultron_memory_vault.json): `ultron_memory_vault.json`
- [Research API](https://github.com/ashish7802/ultron/blob/main/app/api/research/route.ts): `app/api/research/route.ts`
- [Research Orchestrator](https://github.com/ashish7802/ultron/blob/main/lib/research/orchestrator.ts): `lib/research/orchestrator.ts`
- [Research Repository](https://github.com/ashish7802/ultron/blob/main/lib/research/repository.ts): `lib/research/repository.ts`

### Security and Privacy

- [Permission Gateway](https://github.com/ashish7802/ultron/blob/main/lib/permissionGateway.ts): `lib/permissionGateway.ts`
- [Permission Engine](https://github.com/ashish7802/ultron/blob/main/lib/security/permissionEngine.ts): `lib/security/permissionEngine.ts`
- [App Path Service](https://github.com/ashish7802/ultron/blob/main/lib/security/appPathService.ts): `lib/security/appPathService.ts`
- [Screen Privacy](https://github.com/ashish7802/ultron/blob/main/lib/screenPrivacyController.ts): `lib/screenPrivacyController.ts`

### Other components

- **User**
- **Local Python Services**

## Connections

- User → Assistant UI: uses (evidence: `README.md`)
- Assistant UI → Chat API: sends requests (evidence: `README.md`)
- Chat API → Response Decision: evaluates utterance (evidence: `app/api/chat/route.ts`)
- Chat API → Cognitive Engines: uses reasoning (evidence: `app/api/chat/route.ts`)
- Chat API → Local Model Client: invokes model (evidence: `app/api/chat/route.ts`)
- Chat API → Memory Manager: handles memory (evidence: `app/api/chat/route.ts`)
- Chat API → System Control: dispatches control (evidence: `app/api/chat/route.ts`)
- Chat API → Research API: runs research (evidence: `app/api/chat/route.ts`)
- Research API → Research Orchestrator: invokes workflow (evidence: `app/api/research/route.ts`)
- Memory Manager → Memory Coordinator: coordinates (evidence: `lib/memoryManager.ts`)
- Memory Manager → Memory Vault: persists memory (evidence: `lib/memoryManager.ts`)
- Memory Manager → App Path Service: resolves storage (evidence: `lib/memoryManager.ts`)
- Research Orchestrator → Research Repository: uses repository
- Chat API → Permission Gateway: checks access (evidence: `app/api/chat/route.ts`)
- Permission Gateway → Permission Engine: enforces approvals
- System Control → Computer Tools: requests desktop actions
- Computer Tools → Python Bridge: bridges runtime
- Python Bridge → Local Python Services: calls local runtime
- Assistant UI → Electron Shell: runs inside (evidence: `README.md`)
- Chat API → Voice Runtime: connects voice APIs (evidence: `README.md`)
- Screen Intelligence → Screen Privacy: checks capture policy (evidence: `lib/screen/contextDeliveryEngine.ts`)
- Screen Intelligence → Vision Control: uses vision control (evidence: `lib/screen/contextDeliveryEngine.ts`)
- Screen Intelligence → Temporal Screen: uses temporal analysis (evidence: `lib/screen/contextDeliveryEngine.ts`)
- Electron Shell → Local Python Services: starts local services (evidence: `README.md`)
