# alperenunalhacking/nesilai architecture

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

## Overview

NesilAI is a browser-based AI assistant combining provider-backed chat with image, speech, OCR, screen-assistant, and standalone creative tools. The main user path is composing a message in the web UI, optionally attaching an image or using speech input, then receiving a streamed model response with optional speech playback. Other substantial branches include coding, multi-agent chat, and OpenView screen analysis. Edges are limited to relationships shown in the excerpts or documented by the README; several indexed modules were not sampled, so their internal wiring is not inferred.

Main entry points: [`js/app.js`](https://github.com/alperenunalhacking/nesilai/blob/main/js/app.js) (Chat orchestration), [`js/ai.js`](https://github.com/alperenunalhacking/nesilai/blob/main/js/ai.js) (Provider AI layer), [`index.html`](https://github.com/alperenunalhacking/nesilai/blob/main/index.html) (Web app UI), [`js/nesilllm.js`](https://github.com/alperenunalhacking/nesilai/blob/main/js/nesilllm.js) (LLM workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_conversation["Conversation and AI"]
  node_webui["Web app UI<br/>[index.html]"]
  node_app["Chat orchestration<br/>[app.js]"]
  node_ai["Provider AI layer<br/>[ai.js]"]
  node_providers(("AI providers"))
  node_llm["LLM workspace<br/>[nesilllm.js]"]
  node_sim["AI chat simulator<br/>[aichatsim.js]"]
  node_research["Web research<br/>[research.js]"]
end

subgraph group_creative["Media and speech tools"]
  node_imagegen["Image generation<br/>[textToPhoto.js]"]
  node_media["Audio and video engine<br/>[media.js]"]
  node_stt["Speech recognition<br/>[stt.js]"]
  node_tts["Speech synthesis<br/>[tts.js]"]
  node_ocr["Image OCR<br/>[photoToText.js]"]
  node_mediaapis(("Media services"))
  node_browseraudio(("Browser speech APIs"))
end

subgraph group_workspace["Assistant workspaces"]
  node_coder["Coding workspace<br/>[nesilcode.js]"]
  node_openview["OpenView screen assistant<br/>[openview.js]"]
  node_capture["Screen capture and vision"]
  node_projectfiles["Project files<br/>[projectfiles.js]"]
end

subgraph group_state["Local state"]
  node_memory["Assistant memory<br/>[memory.js]"]
  node_storage[("Persistent media store<br/>[storage.js]")]
end

node_user(("User"))

node_user -->|"uses"| node_webui
node_webui -->|"hosts"| node_app
node_app -->|"requests responses"| node_ai
node_ai -->|"sends requests"| node_providers
node_app -->|"routes image requests"| node_imagegen
node_app -->|"uses for speech input"| node_stt
node_app -->|"offers response playback"| node_tts
node_app -->|"extracts attachment text"| node_ocr
node_llm -->|"calls chat"| node_ai
node_sim -->|"calls chat"| node_ai
node_capture -->|"sends vision analysis"| node_ai
node_imagegen -->|"requests images"| node_mediaapis
node_media -->|"requests generated media"| node_mediaapis
node_stt -->|"uses speech APIs"| node_browseraudio
node_tts -->|"uses speech synthesis"| node_browseraudio
node_user -->|"opens workspace"| node_llm
node_user -->|"participates in chats"| node_sim
node_user -->|"opens coding mode"| node_coder
node_user -->|"uses screen assistant"| node_openview

click node_webui "https://github.com/alperenunalhacking/nesilai/blob/main/index.html"
click node_app "https://github.com/alperenunalhacking/nesilai/blob/main/js/app.js"
click node_ai "https://github.com/alperenunalhacking/nesilai/blob/main/js/ai.js"
click node_llm "https://github.com/alperenunalhacking/nesilai/blob/main/js/nesilllm.js"
click node_sim "https://github.com/alperenunalhacking/nesilai/blob/main/js/aichatsim.js"
click node_research "https://github.com/alperenunalhacking/nesilai/blob/main/js/research.js"
click node_imagegen "https://github.com/alperenunalhacking/nesilai/blob/main/js/textToPhoto.js"
click node_media "https://github.com/alperenunalhacking/nesilai/blob/main/js/media.js"
click node_stt "https://github.com/alperenunalhacking/nesilai/blob/main/js/stt.js"
click node_tts "https://github.com/alperenunalhacking/nesilai/blob/main/js/tts.js"
click node_ocr "https://github.com/alperenunalhacking/nesilai/blob/main/js/photoToText.js"
click node_coder "https://github.com/alperenunalhacking/nesilai/blob/main/js/nesilcode.js"
click node_openview "https://github.com/alperenunalhacking/nesilai/blob/main/js/openview.js"
click node_capture "https://github.com/alperenunalhacking/nesilai/blob/main/js/openview-capture.js"
click node_projectfiles "https://github.com/alperenunalhacking/nesilai/blob/main/js/projectfiles.js"
click node_memory "https://github.com/alperenunalhacking/nesilai/blob/main/js/memory.js"
click node_storage "https://github.com/alperenunalhacking/nesilai/blob/main/js/storage.js"

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_webui,node_app,node_ai,node_providers,node_llm,node_sim,node_research,node_user toneBlue
class node_imagegen,node_media,node_stt,node_tts,node_ocr,node_mediaapis,node_browseraudio toneAmber
class node_coder,node_openview,node_capture,node_projectfiles toneMint
class node_memory,node_storage toneRose
```

## Components

### Conversation and AI

- [Web app UI](https://github.com/alperenunalhacking/nesilai/blob/main/index.html): `index.html`
- [Chat orchestration](https://github.com/alperenunalhacking/nesilai/blob/main/js/app.js): `js/app.js`
- [Provider AI layer](https://github.com/alperenunalhacking/nesilai/blob/main/js/ai.js): `js/ai.js`
- **AI providers**
- [LLM workspace](https://github.com/alperenunalhacking/nesilai/blob/main/js/nesilllm.js): `js/nesilllm.js`
- [AI chat simulator](https://github.com/alperenunalhacking/nesilai/blob/main/js/aichatsim.js): `js/aichatsim.js`
- [Web research](https://github.com/alperenunalhacking/nesilai/blob/main/js/research.js): `js/research.js`

### Media and speech tools

- [Image generation](https://github.com/alperenunalhacking/nesilai/blob/main/js/textToPhoto.js): `js/textToPhoto.js`
- [Audio and video engine](https://github.com/alperenunalhacking/nesilai/blob/main/js/media.js): `js/media.js`
- [Speech recognition](https://github.com/alperenunalhacking/nesilai/blob/main/js/stt.js): `js/stt.js`
- [Speech synthesis](https://github.com/alperenunalhacking/nesilai/blob/main/js/tts.js): `js/tts.js`
- [Image OCR](https://github.com/alperenunalhacking/nesilai/blob/main/js/photoToText.js): `js/photoToText.js`
- **Media services**
- **Browser speech APIs**

### Assistant workspaces

- [Coding workspace](https://github.com/alperenunalhacking/nesilai/blob/main/js/nesilcode.js): `js/nesilcode.js`
- [OpenView screen assistant](https://github.com/alperenunalhacking/nesilai/blob/main/js/openview.js): `js/openview.js`
- [Screen capture and vision](https://github.com/alperenunalhacking/nesilai/blob/main/js/openview-capture.js): `js/openview-capture.js`
- [Project files](https://github.com/alperenunalhacking/nesilai/blob/main/js/projectfiles.js): `js/projectfiles.js`

### Local state

- [Assistant memory](https://github.com/alperenunalhacking/nesilai/blob/main/js/memory.js): `js/memory.js`
- [Persistent media store](https://github.com/alperenunalhacking/nesilai/blob/main/js/storage.js): `js/storage.js`

### Other components

- **User**

## Connections

- User → Web app UI: uses (evidence: `README.md`)
- Web app UI → Chat orchestration: hosts (evidence: `README.md`)
- Chat orchestration → Provider AI layer: requests responses (evidence: `README.md`)
- Provider AI layer → AI providers: sends requests (evidence: `README.md`)
- Chat orchestration → Image generation: routes image requests (evidence: `README.md`)
- Chat orchestration → Speech recognition: uses for speech input (evidence: `README.md`)
- Chat orchestration → Speech synthesis: offers response playback (evidence: `README.md`)
- Chat orchestration → Image OCR: extracts attachment text (evidence: `js/app.js`)
- LLM workspace → Provider AI layer: calls chat (evidence: `js/nesilllm.js`)
- AI chat simulator → Provider AI layer: calls chat (evidence: `js/aichatsim.js`)
- Screen capture and vision → Provider AI layer: sends vision analysis (evidence: `js/openview-capture.js`)
- Image generation → Media services: requests images (evidence: `README.md`)
- Audio and video engine → Media services: requests generated media (evidence: `js/media.js`)
- Speech recognition → Browser speech APIs: uses speech APIs (evidence: `js/stt.js`)
- Speech synthesis → Browser speech APIs: uses speech synthesis (evidence: `README.md`)
- User → LLM workspace: opens workspace (evidence: `js/nesilllm.js`)
- User → AI chat simulator: participates in chats (evidence: `js/aichatsim.js`)
- User → Coding workspace: opens coding mode (evidence: `js/nesilcode.js`)
- User → OpenView screen assistant: uses screen assistant (evidence: `js/openview.js`)
