# hackertech142/liya-ai-workstation architecture

> Architecture diagram of the GitHub repository hackertech142/liya-ai-workstation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hackertech142/liya-ai-workstation
- Repository: https://github.com/hackertech142/liya-ai-workstation

## Overview

LIYA is an agentic desktop companion: a user starts in the React workstation, sends a chat or app request, and the frontend’s AI workflow plans a response or tool action; results appear in chat or the interactive Canvas. Its domain stages include model routing, multi-agent work, memory, and specialized mini-app capabilities, backed by an Express API and local media processing. The README documents several capabilities whose implementation details are not sampled; those branches are shown at subsystem level, and their documented links cite the README.

Main entry points: [`backend/server.js`](https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/server.js) (HTTP API), [`src/App.jsx`](https://github.com/hackertech142/liya-ai-workstation/blob/main/src/App.jsx) (LIYA App), [`src/hooks/useOllama.js`](https://github.com/hackertech142/liya-ai-workstation/blob/main/src/hooks/useOllama.js) (Chat Workflow), [`src/utils/orchestrator.js`](https://github.com/hackertech142/liya-ai-workstation/blob/main/src/utils/orchestrator.js) (AI Orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workstation["Desktop Workstation"]
  node_app["LIYA App<br/>[App.jsx]"]
  node_chat["Chat Workflow<br/>[useOllama.js]"]
  node_canvas["Visual Canvas<br/>[Canvas.jsx]"]
end

subgraph group_intelligence["AI and Agents"]
  node_routing["Model Router<br/>[router.js]"]
  node_orchestrator["AI Orchestrator<br/>[orchestrator.js]"]
  node_agents["Multi-Agent Workers<br/>[subagentTool.js]"]
  node_blackboard["Shared Blackboard<br/>[blackboard.js]"]
  node_tools["Tool Registry<br/>[toolRegistry.js]"]
  node_memory[("Long-Term Memory<br/>[MemoryManager.js]")]
end

subgraph group_backend["Backend Services"]
  node_server["HTTP API<br/>[server.js]"]
  node_engine["Backend Tools<br/>[toolEngine.js]"]
  node_scraper["Web Ingestion<br/>[smartScraper.js]"]
  node_voice["Neural Voice<br/>[voiceEngine.js]"]
  node_scheduler["Task Scheduler<br/>[scheduler.js]"]
  node_mcp["MCP Tools<br/>[mcpManager.js]"]
  node_vision["Vision Analysis<br/>[visionHandler.js]"]
end

subgraph group_capabilities["Product Capabilities"]
  node_faceswap["Face Swap<br/>[faceswap.py]"]
  node_video["Video Face Swap<br/>[videoswap.py]"]
  node_miniapps["Mini Apps"]
end

node_user(("User"))
node_external(("Cloud and Web Services"))

node_user -->|"uses"| node_app
node_app -->|"starts chat"| node_chat
node_chat -->|"plans actions"| node_orchestrator
node_chat -->|"selects model"| node_routing
node_chat -->|"adds context"| node_memory
node_chat -->|"reads notes"| node_blackboard
node_orchestrator -->|"routes roles"| node_routing
node_orchestrator -->|"dispatches agents"| node_agents
node_orchestrator -->|"executes tools"| node_tools
node_orchestrator -->|"stores facts"| node_memory
node_agents -->|"reads state"| node_blackboard
node_agents -->|"selects model"| node_routing
node_agents -->|"calls model API"| node_external
node_tools -->|"requests services"| node_server
node_app -->|"shows visuals"| node_canvas
node_app -->|"opens apps"| node_miniapps
node_app -->|"uses API"| node_server
node_server -->|"routes ingestion"| node_scraper
node_server -->|"routes analysis"| node_vision
node_server -->|"dispatches tools"| node_engine
node_server -->|"configures tasks"| node_scheduler
node_server -->|"routes MCP calls"| node_mcp
node_server -->|"serves speech"| node_voice
node_server -->|"runs image swap"| node_faceswap
node_server -->|"runs video swap"| node_video
node_memory -->|"syncs memories"| node_external
node_scraper -->|"ingests web pages"| node_external
node_scheduler -->|"runs automations"| node_external

click node_app "https://github.com/hackertech142/liya-ai-workstation/blob/main/src/App.jsx"
click node_chat "https://github.com/hackertech142/liya-ai-workstation/blob/main/src/hooks/useOllama.js"
click node_canvas "https://github.com/hackertech142/liya-ai-workstation/blob/main/src/components/Canvas.jsx"
click node_routing "https://github.com/hackertech142/liya-ai-workstation/blob/main/src/utils/router.js"
click node_orchestrator "https://github.com/hackertech142/liya-ai-workstation/blob/main/src/utils/orchestrator.js"
click node_agents "https://github.com/hackertech142/liya-ai-workstation/blob/main/src/utils/agents/subagentTool.js"
click node_blackboard "https://github.com/hackertech142/liya-ai-workstation/blob/main/src/utils/agents/blackboard.js"
click node_tools "https://github.com/hackertech142/liya-ai-workstation/blob/main/src/utils/toolRegistry.js"
click node_memory "https://github.com/hackertech142/liya-ai-workstation/blob/main/src/utils/MemoryManager.js"
click node_server "https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/server.js"
click node_engine "https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/toolEngine.js"
click node_scraper "https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/smartScraper.js"
click node_voice "https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/voiceEngine.js"
click node_scheduler "https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/scheduler.js"
click node_mcp "https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/mcpManager.js"
click node_vision "https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/visionHandler.js"
click node_faceswap "https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/bin/faceswap.py"
click node_video "https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/bin/videoswap.py"
click node_miniapps "https://github.com/hackertech142/liya-ai-workstation/blob/main/src/components/AppLauncherModal.jsx"

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_app,node_chat,node_canvas,node_user toneBlue
class node_routing,node_orchestrator,node_agents,node_blackboard,node_tools,node_memory toneAmber
class node_server,node_engine,node_scraper,node_voice,node_scheduler,node_mcp,node_vision toneMint
class node_faceswap,node_video,node_miniapps toneRose
class node_external toneIndigo
```

## Components

### Desktop Workstation

- [LIYA App](https://github.com/hackertech142/liya-ai-workstation/blob/main/src/App.jsx): `src/App.jsx`
- [Chat Workflow](https://github.com/hackertech142/liya-ai-workstation/blob/main/src/hooks/useOllama.js): `src/hooks/useOllama.js`
- [Visual Canvas](https://github.com/hackertech142/liya-ai-workstation/blob/main/src/components/Canvas.jsx): `src/components/Canvas.jsx`

### AI and Agents

- [Model Router](https://github.com/hackertech142/liya-ai-workstation/blob/main/src/utils/router.js): `src/utils/router.js`
- [AI Orchestrator](https://github.com/hackertech142/liya-ai-workstation/blob/main/src/utils/orchestrator.js): `src/utils/orchestrator.js`
- [Multi-Agent Workers](https://github.com/hackertech142/liya-ai-workstation/blob/main/src/utils/agents/subagentTool.js): `src/utils/agents/subagentTool.js`
- [Shared Blackboard](https://github.com/hackertech142/liya-ai-workstation/blob/main/src/utils/agents/blackboard.js): `src/utils/agents/blackboard.js`
- [Tool Registry](https://github.com/hackertech142/liya-ai-workstation/blob/main/src/utils/toolRegistry.js): `src/utils/toolRegistry.js`
- [Long-Term Memory](https://github.com/hackertech142/liya-ai-workstation/blob/main/src/utils/MemoryManager.js): `src/utils/MemoryManager.js`

### Backend Services

- [HTTP API](https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/server.js): `backend/server.js`
- [Backend Tools](https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/toolEngine.js): `backend/toolEngine.js`
- [Web Ingestion](https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/smartScraper.js): `backend/smartScraper.js`
- [Neural Voice](https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/voiceEngine.js): `backend/voiceEngine.js`
- [Task Scheduler](https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/scheduler.js): `backend/scheduler.js`
- [MCP Tools](https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/mcpManager.js): `backend/mcpManager.js`
- [Vision Analysis](https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/visionHandler.js): `backend/visionHandler.js`

### Product Capabilities

- [Face Swap](https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/bin/faceswap.py): `backend/bin/faceswap.py`
- [Video Face Swap](https://github.com/hackertech142/liya-ai-workstation/blob/main/backend/bin/videoswap.py): `backend/bin/videoswap.py`
- [Mini Apps](https://github.com/hackertech142/liya-ai-workstation/blob/main/src/components/AppLauncherModal.jsx): `src/components/AppLauncherModal.jsx`

### Other components

- **User**
- **Cloud and Web Services**

## Connections

- User → LIYA App: uses (evidence: `README.md`)
- LIYA App → Chat Workflow: starts chat (evidence: `src/App.jsx`)
- Chat Workflow → AI Orchestrator: plans actions (evidence: `src/hooks/useOllama.js`)
- Chat Workflow → Model Router: selects model (evidence: `src/hooks/useOllama.js`)
- Chat Workflow → Long-Term Memory: adds context (evidence: `src/hooks/useOllama.js`)
- Chat Workflow → Shared Blackboard: reads notes (evidence: `src/hooks/useOllama.js`)
- AI Orchestrator → Model Router: routes roles (evidence: `src/utils/orchestrator.js`)
- AI Orchestrator → Multi-Agent Workers: dispatches agents (evidence: `src/utils/orchestrator.js`)
- AI Orchestrator → Tool Registry: executes tools (evidence: `src/utils/orchestrator.js`)
- AI Orchestrator → Long-Term Memory: stores facts (evidence: `src/utils/orchestrator.js`)
- Multi-Agent Workers → Shared Blackboard: reads state (evidence: `src/utils/agents/subagentTool.js`)
- Multi-Agent Workers → Model Router: selects model (evidence: `src/utils/agents/subagentTool.js`)
- Multi-Agent Workers → Cloud and Web Services: calls model API (evidence: `src/utils/agents/subagentTool.js`)
- Tool Registry → HTTP API: requests services (evidence: `src/utils/toolRegistry.js`)
- LIYA App → Visual Canvas: shows visuals (evidence: `README.md`)
- LIYA App → Mini Apps: opens apps (evidence: `README.md`)
- LIYA App → HTTP API: uses API (evidence: `src/App.jsx`)
- HTTP API → Web Ingestion: routes ingestion (evidence: `backend/server.js`)
- HTTP API → Vision Analysis: routes analysis (evidence: `backend/server.js`)
- HTTP API → Backend Tools: dispatches tools (evidence: `backend/toolEngine.js`)
- HTTP API → Task Scheduler: configures tasks (evidence: `backend/server.js`)
- HTTP API → MCP Tools: routes MCP calls (evidence: `backend/server.js`)
- HTTP API → Neural Voice: serves speech (evidence: `README.md`)
- HTTP API → Face Swap: runs image swap (evidence: `README.md`)
- HTTP API → Video Face Swap: runs video swap (evidence: `README.md`)
- Long-Term Memory → Cloud and Web Services: syncs memories (evidence: `README.md`)
- Web Ingestion → Cloud and Web Services: ingests web pages (evidence: `README.md`)
- Task Scheduler → Cloud and Web Services: runs automations (evidence: `README.md`)
