# bhoomik-codes/kurumi architecture

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

- Interactive diagram: https://gitdiagram.com/bhoomik-codes/kurumi
- Repository: https://github.com/bhoomik-codes/kurumi

## Overview

KURUMI is a local-first AI application whose persistent daemon serves inference, storage, and worker operations to CLI, TUI, and Electron clients. The main workflow is a user query through a client to the daemon, which streams a selected provider’s response and persists conversation history. The GUI also exposes model management, document RAG, image generation, voice, and interactive artifacts. The README documents the daemon-client relationships and capabilities; sampled source confirms key daemon, worker, and Electron wiring, but not every GUI subsystem’s implementation.

Main entry points: [`src/daemon/server.ts`](https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/server.ts) (HTTP daemon), [`src/App.tsx`](https://github.com/bhoomik-codes/kurumi/blob/main/src/App.tsx) (GUI routes), [`src/pages/Chat.tsx`](https://github.com/bhoomik-codes/kurumi/blob/main/src/pages/Chat.tsx) (Chat interface), [`src/daemon/workerManager.ts`](https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/workerManager.ts) (Worker manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Client surfaces"]
  node_cli["CLI client<br/>[index.ts]"]
  node_tui["Terminal UI<br/>[tui.tsx]"]
  node_electron["Electron host<br/>[main.ts]"]
end

subgraph group_daemon["Daemon core"]
  node_daemon_server["HTTP daemon<br/>[server.ts]"]
  node_database[("Conversation database<br/>[db.ts]")]
  node_supervisor["Process supervisor<br/>[supervisor.ts]"]
end

subgraph group_inference["Inference providers"]
  node_ollama["Ollama provider<br/>[OllamaService.ts]"]
  node_airllm["AirLLM provider<br/>[AirLLMService.ts]"]
  node_nvidia["NVIDIA provider<br/>[NvidiaService.ts]"]
end

subgraph group_knowledge["Knowledge and voice"]
  node_worker_manager["Worker manager<br/>[workerManager.ts]"]
  node_rag_tasks["RAG worker tasks<br/>[ragWorkerTasks.ts]"]
  node_vector_store[("Vector store<br/>[vectorStoreCore.ts]")]
  node_voice_tasks["Voice transcription"]
end

subgraph group_gui_features["GUI capabilities"]
  node_chat_ui["Chat interface<br/>[Chat.tsx]"]
  node_app_routes["GUI routes<br/>[App.tsx]"]
  node_documents["Document management<br/>[Documents.tsx]"]
  node_image_gen["Image generation<br/>[ImageGen.tsx]"]
  node_model_management["Model management<br/>[Models.tsx]"]
  node_model_store["Model store<br/>[ModelStore.tsx]"]
  node_artifacts["Interactive artifacts<br/>[ReactArtifact.tsx]"]
end

node_user(("User"))
node_ollama_service["Ollama runtime"]
node_airllm_service["AirLLM server<br/>[airllm_server.py]"]
node_nvidia_service["NVIDIA API"]

node_user -->|"queries"| node_cli
node_user -->|"chats"| node_tui
node_user -->|"chats"| node_chat_ui
node_cli -->|"HTTP requests"| node_daemon_server
node_tui -->|"HTTP requests"| node_daemon_server
node_electron -->|"starts and checks"| node_daemon_server
node_chat_ui -->|"streams chat"| node_daemon_server
node_app_routes -->|"routes to"| node_chat_ui
node_app_routes -->|"routes to"| node_documents
node_app_routes -->|"routes to"| node_image_gen
node_app_routes -->|"routes to"| node_model_management
node_app_routes -->|"routes to"| node_model_store
node_chat_ui -.->|"renders"| node_artifacts
node_daemon_server -->|"reads and writes"| node_database
node_daemon_server -->|"dispatches inference"| node_ollama
node_daemon_server -->|"dispatches inference"| node_airllm
node_daemon_server -->|"dispatches inference"| node_nvidia
node_ollama -.->|"calls"| node_ollama_service
node_airllm -->|"calls"| node_airllm_service
node_nvidia -.->|"calls"| node_nvidia_service
node_daemon_server -->|"starts processes"| node_supervisor
node_daemon_server -->|"routes worker jobs"| node_worker_manager
node_worker_manager -.->|"dispatches tasks"| node_rag_tasks
node_rag_tasks -->|"indexes and searches"| node_vector_store
node_documents -.->|"uses RAG API"| node_daemon_server
node_worker_manager -.->|"dispatches transcription"| node_voice_tasks
node_image_gen -.->|"uses image service"| node_daemon_server
node_model_management -.->|"manages models"| node_daemon_server
node_model_store -.->|"uses model API"| node_daemon_server

click node_cli "https://github.com/bhoomik-codes/kurumi/blob/main/src/cli/index.ts"
click node_tui "https://github.com/bhoomik-codes/kurumi/blob/main/src/cli/tui.tsx"
click node_electron "https://github.com/bhoomik-codes/kurumi/blob/main/electron/main.ts"
click node_chat_ui "https://github.com/bhoomik-codes/kurumi/blob/main/src/pages/Chat.tsx"
click node_app_routes "https://github.com/bhoomik-codes/kurumi/blob/main/src/App.tsx"
click node_daemon_server "https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/server.ts"
click node_database "https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/db.ts"
click node_supervisor "https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/supervisor.ts"
click node_ollama "https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/services/OllamaService.ts"
click node_airllm "https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/services/AirLLMService.ts"
click node_nvidia "https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/services/NvidiaService.ts"
click node_worker_manager "https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/workerManager.ts"
click node_rag_tasks "https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/worker/ragWorkerTasks.ts"
click node_vector_store "https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/services/vectorStoreCore.ts"
click node_voice_tasks "https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/worker/voiceWorkerTasks.ts"
click node_documents "https://github.com/bhoomik-codes/kurumi/blob/main/src/pages/Documents.tsx"
click node_image_gen "https://github.com/bhoomik-codes/kurumi/blob/main/src/pages/ImageGen.tsx"
click node_model_management "https://github.com/bhoomik-codes/kurumi/blob/main/src/pages/Models.tsx"
click node_model_store "https://github.com/bhoomik-codes/kurumi/blob/main/src/pages/ModelStore.tsx"
click node_artifacts "https://github.com/bhoomik-codes/kurumi/blob/main/src/components/artifacts/ReactArtifact.tsx"
click node_airllm_service "https://github.com/bhoomik-codes/kurumi/blob/main/airllm_server.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_cli,node_tui,node_electron,node_user toneBlue
class node_daemon_server,node_database,node_supervisor toneAmber
class node_ollama,node_airllm,node_nvidia,node_airllm_service,node_nvidia_service toneMint
class node_worker_manager,node_rag_tasks,node_vector_store,node_voice_tasks toneRose
class node_chat_ui,node_app_routes,node_documents,node_image_gen,node_model_management,node_model_store,node_artifacts,node_ollama_service toneIndigo
```

## Components

### Client surfaces

- [CLI client](https://github.com/bhoomik-codes/kurumi/blob/main/src/cli/index.ts): `src/cli/index.ts`
- [Terminal UI](https://github.com/bhoomik-codes/kurumi/blob/main/src/cli/tui.tsx): `src/cli/tui.tsx`
- [Electron host](https://github.com/bhoomik-codes/kurumi/blob/main/electron/main.ts): `electron/main.ts`

### Daemon core

- [HTTP daemon](https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/server.ts): `src/daemon/server.ts`
- [Conversation database](https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/db.ts): `src/daemon/db.ts`
- [Process supervisor](https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/supervisor.ts): `src/daemon/supervisor.ts`

### Inference providers

- [Ollama provider](https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/services/OllamaService.ts): `src/daemon/services/OllamaService.ts`
- [AirLLM provider](https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/services/AirLLMService.ts): `src/daemon/services/AirLLMService.ts`
- [NVIDIA provider](https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/services/NvidiaService.ts): `src/daemon/services/NvidiaService.ts`

### Knowledge and voice

- [Worker manager](https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/workerManager.ts): `src/daemon/workerManager.ts`
- [RAG worker tasks](https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/worker/ragWorkerTasks.ts): `src/daemon/worker/ragWorkerTasks.ts`
- [Vector store](https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/services/vectorStoreCore.ts): `src/daemon/services/vectorStoreCore.ts`
- [Voice transcription](https://github.com/bhoomik-codes/kurumi/blob/main/src/daemon/worker/voiceWorkerTasks.ts): `src/daemon/worker/voiceWorkerTasks.ts`

### GUI capabilities

- [Chat interface](https://github.com/bhoomik-codes/kurumi/blob/main/src/pages/Chat.tsx): `src/pages/Chat.tsx`
- [GUI routes](https://github.com/bhoomik-codes/kurumi/blob/main/src/App.tsx): `src/App.tsx`
- [Document management](https://github.com/bhoomik-codes/kurumi/blob/main/src/pages/Documents.tsx): `src/pages/Documents.tsx`
- [Image generation](https://github.com/bhoomik-codes/kurumi/blob/main/src/pages/ImageGen.tsx): `src/pages/ImageGen.tsx`
- [Model management](https://github.com/bhoomik-codes/kurumi/blob/main/src/pages/Models.tsx): `src/pages/Models.tsx`
- [Model store](https://github.com/bhoomik-codes/kurumi/blob/main/src/pages/ModelStore.tsx): `src/pages/ModelStore.tsx`
- [Interactive artifacts](https://github.com/bhoomik-codes/kurumi/blob/main/src/components/artifacts/ReactArtifact.tsx): `src/components/artifacts/ReactArtifact.tsx`

### Other components

- **User**
- **Ollama runtime**
- [AirLLM server](https://github.com/bhoomik-codes/kurumi/blob/main/airllm_server.py): `airllm_server.py`
- **NVIDIA API**

## Connections

- User → CLI client: queries (evidence: `README.md`)
- User → Terminal UI: chats (evidence: `README.md`)
- User → Chat interface: chats (evidence: `README.md`)
- CLI client → HTTP daemon: HTTP requests (evidence: `README.md`)
- Terminal UI → HTTP daemon: HTTP requests (evidence: `README.md`)
- Electron host → HTTP daemon: starts and checks (evidence: `electron/main.ts`)
- Chat interface → HTTP daemon: streams chat (evidence: `README.md`)
- GUI routes → Chat interface: routes to (evidence: `src/App.tsx`)
- GUI routes → Document management: routes to (evidence: `src/App.tsx`)
- GUI routes → Image generation: routes to (evidence: `src/App.tsx`)
- GUI routes → Model management: routes to (evidence: `src/App.tsx`)
- GUI routes → Model store: routes to (evidence: `src/App.tsx`)
- Chat interface → Interactive artifacts: renders
- HTTP daemon → Conversation database: reads and writes (evidence: `src/daemon/server.ts`)
- HTTP daemon → Ollama provider: dispatches inference (evidence: `src/daemon/server.ts`)
- HTTP daemon → AirLLM provider: dispatches inference (evidence: `src/daemon/server.ts`)
- HTTP daemon → NVIDIA provider: dispatches inference (evidence: `src/daemon/server.ts`)
- Ollama provider → Ollama runtime: calls
- AirLLM provider → AirLLM server: calls (evidence: `src/daemon/services/AirLLMService.ts`)
- NVIDIA provider → NVIDIA API: calls
- HTTP daemon → Process supervisor: starts processes (evidence: `src/daemon/server.ts`)
- HTTP daemon → Worker manager: routes worker jobs (evidence: `README.md`)
- Worker manager → RAG worker tasks: dispatches tasks
- RAG worker tasks → Vector store: indexes and searches (evidence: `src/daemon/worker/ragWorkerTasks.ts`)
- Document management → HTTP daemon: uses RAG API
- Worker manager → Voice transcription: dispatches transcription
- Image generation → HTTP daemon: uses image service
- Model management → HTTP daemon: manages models
- Model store → HTTP daemon: uses model API
