# nishadislamutso/oddbrain architecture

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

- Interactive diagram: https://gitdiagram.com/nishadislamutso/oddbrain
- Repository: https://github.com/nishadislamutso/oddbrain

## Overview

AI ASSistant is the repository’s active product: a local-first Electron desktop assistant that chats with local or user-authorized cloud models, uses an Obsidian vault as durable memory, and produces artifacts. The central workflow is user prompt → chat and engine → response or artifact, with vault context and capture available alongside it. The README also documents settings-controlled permissions, projects, skills, browsing maps, and an extension capture port. Historical Claude-clone apps are excluded. Some feature links rely on README documentation because their implementation was not sampled.

Main entry points: [`apps/03_ai-assistant/src/renderer/src/App.tsx`](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/App.tsx) (App shell), [`apps/03_ai-assistant/src/renderer/src/state/engine.ts`](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/state/engine.ts) (Engine control), [`apps/03_ai-assistant/src/renderer/src/hooks/useChat.ts`](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/hooks/useChat.ts) (Chat orchestration), [`apps/03_ai-assistant/src/shared/lib/engine.ts`](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/shared/lib/engine.ts) (Engine services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop experience"]
  node_renderer["App shell<br/>[App.tsx]"]
  node_chatview["Chat view<br/>[ChatView.tsx]"]
  node_settings["Settings<br/>[SettingsView.tsx]"]
  node_artifacts["Artifacts<br/>[ArtifactsView.tsx]"]
  node_projects["Projects<br/>[ProjectsView.tsx]"]
  node_memorymap["Browsing maps<br/>[MemoryMap.tsx]"]
end

subgraph group_conversation["Chat and intelligence"]
  node_chatflow["Chat orchestration<br/>[useChat.ts]"]
  node_engine["Engine control<br/>[engine.ts]"]
  node_enginebay["Engine management<br/>[EngineBay.tsx]"]
  node_sharedengine["Engine services<br/>[engine.ts]"]
  node_artifactstore[("Artifact storage<br/>[store.ts]")]
end

subgraph group_memory["Vault and memory"]
  node_vaultview["Vault view<br/>[VaultView.tsx]"]
  node_vaultservice["Vault service<br/>[service.ts]"]
  node_vaultroutes["Vault routes<br/>[routes.ts]"]
  node_vaultfiles[("Obsidian vault")]
end

subgraph group_platform["Local services"]
  node_api["Local API<br/>[server.ts]"]
  node_extensionport["Extension port<br/>[server.ts]"]
end

node_user(("User"))
node_ollama["Ollama"]
node_cloud["Cloud providers"]
node_browserextension["Browser extension<br/>[background.js]"]

node_user -->|"uses"| node_renderer
node_renderer -->|"shows"| node_chatview
node_renderer -->|"shows"| node_settings
node_renderer -->|"shows"| node_artifacts
node_renderer -->|"shows"| node_projects
node_renderer -->|"shows"| node_memorymap
node_chatview -.->|"submits messages"| node_chatflow
node_chatflow -.->|"sends prompt"| node_engine
node_engine -.->|"uses services"| node_sharedengine
node_enginebay -.->|"manages"| node_engine
node_sharedengine -.->|"uses local model"| node_ollama
node_sharedengine -.->|"uses when authorized"| node_cloud
node_settings -.->|"governs permissions"| node_engine
node_artifacts -.->|"manages artifacts"| node_artifactstore
node_vaultview -.->|"accesses vault"| node_api
node_api -->|"routes requests"| node_vaultroutes
node_vaultroutes -->|"dispatches"| node_vaultservice
node_vaultservice -->|"reads and writes"| node_vaultfiles
node_chatflow -.->|"captures to vault"| node_api
node_memorymap -.->|"reads maps"| node_vaultservice
node_extensionport -->|"serves capture routes"| node_vaultroutes
node_browserextension -.->|"sends captures"| node_extensionport

click node_renderer "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/App.tsx"
click node_chatview "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/components/ChatView.tsx"
click node_settings "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/components/SettingsView.tsx"
click node_artifacts "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/components/ArtifactsView.tsx"
click node_projects "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/components/ProjectsView.tsx"
click node_memorymap "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/components/MemoryMap.tsx"
click node_chatflow "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/hooks/useChat.ts"
click node_engine "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/state/engine.ts"
click node_enginebay "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/components/EngineBay.tsx"
click node_sharedengine "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/shared/lib/engine.ts"
click node_artifactstore "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/main/artifacts/store.ts"
click node_vaultview "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/components/VaultView.tsx"
click node_vaultservice "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/main/vault/service.ts"
click node_vaultroutes "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/main/vault/routes.ts"
click node_api "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/main/api/server.ts"
click node_extensionport "https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/main/extension/server.ts"
click node_browserextension "https://github.com/nishadislamutso/oddbrain/blob/main/extension/background.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_renderer,node_chatview,node_settings,node_artifacts,node_projects,node_memorymap,node_user,node_browserextension toneBlue
class node_chatflow,node_engine,node_enginebay,node_sharedengine,node_artifactstore toneAmber
class node_vaultview,node_vaultservice,node_vaultroutes,node_vaultfiles toneMint
class node_api,node_extensionport toneRose
class node_ollama,node_cloud toneIndigo
```

## Components

### Desktop experience

- [App shell](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/App.tsx): `apps/03_ai-assistant/src/renderer/src/App.tsx`
- [Chat view](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/components/ChatView.tsx): `apps/03_ai-assistant/src/renderer/src/components/ChatView.tsx`
- [Settings](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/components/SettingsView.tsx): `apps/03_ai-assistant/src/renderer/src/components/SettingsView.tsx`
- [Artifacts](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/components/ArtifactsView.tsx): `apps/03_ai-assistant/src/renderer/src/components/ArtifactsView.tsx`
- [Projects](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/components/ProjectsView.tsx): `apps/03_ai-assistant/src/renderer/src/components/ProjectsView.tsx`
- [Browsing maps](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/components/MemoryMap.tsx): `apps/03_ai-assistant/src/renderer/src/components/MemoryMap.tsx`

### Chat and intelligence

- [Chat orchestration](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/hooks/useChat.ts): `apps/03_ai-assistant/src/renderer/src/hooks/useChat.ts`
- [Engine control](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/state/engine.ts): `apps/03_ai-assistant/src/renderer/src/state/engine.ts`
- [Engine management](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/components/EngineBay.tsx): `apps/03_ai-assistant/src/renderer/src/components/EngineBay.tsx`
- [Engine services](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/shared/lib/engine.ts): `apps/03_ai-assistant/src/shared/lib/engine.ts`
- [Artifact storage](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/main/artifacts/store.ts): `apps/03_ai-assistant/src/main/artifacts/store.ts`

### Vault and memory

- [Vault view](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/renderer/src/components/VaultView.tsx): `apps/03_ai-assistant/src/renderer/src/components/VaultView.tsx`
- [Vault service](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/main/vault/service.ts): `apps/03_ai-assistant/src/main/vault/service.ts`
- [Vault routes](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/main/vault/routes.ts): `apps/03_ai-assistant/src/main/vault/routes.ts`
- **Obsidian vault**

### Local services

- [Local API](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/main/api/server.ts): `apps/03_ai-assistant/src/main/api/server.ts`
- [Extension port](https://github.com/nishadislamutso/oddbrain/blob/main/apps/03_ai-assistant/src/main/extension/server.ts): `apps/03_ai-assistant/src/main/extension/server.ts`

### Other components

- **User**
- **Ollama**
- **Cloud providers**
- [Browser extension](https://github.com/nishadislamutso/oddbrain/blob/main/extension/background.js): `extension/background.js`

## Connections

- User → App shell: uses (evidence: `README.md`)
- App shell → Chat view: shows (evidence: `apps/03_ai-assistant/src/renderer/src/App.tsx`)
- App shell → Settings: shows (evidence: `apps/03_ai-assistant/src/renderer/src/App.tsx`)
- App shell → Artifacts: shows (evidence: `apps/03_ai-assistant/src/renderer/src/App.tsx`)
- App shell → Projects: shows (evidence: `apps/03_ai-assistant/src/renderer/src/App.tsx`)
- App shell → Browsing maps: shows (evidence: `apps/03_ai-assistant/src/renderer/src/App.tsx`)
- Chat view → Chat orchestration: submits messages
- Chat orchestration → Engine control: sends prompt
- Engine control → Engine services: uses services
- Engine management → Engine control: manages
- Engine services → Ollama: uses local model (evidence: `README.md`)
- Engine services → Cloud providers: uses when authorized (evidence: `README.md`)
- Settings → Engine control: governs permissions (evidence: `README.md`)
- Artifacts → Artifact storage: manages artifacts (evidence: `apps/03_ai-assistant/src/renderer/src/App.tsx`)
- Vault view → Local API: accesses vault (evidence: `README.md`)
- Local API → Vault routes: routes requests (evidence: `apps/03_ai-assistant/src/main/api/server.ts`)
- Vault routes → Vault service: dispatches (evidence: `apps/03_ai-assistant/src/main/vault/routes.ts`)
- Vault service → Obsidian vault: reads and writes (evidence: `apps/03_ai-assistant/src/main/vault/service.ts`)
- Chat orchestration → Local API: captures to vault (evidence: `README.md`)
- Browsing maps → Vault service: reads maps (evidence: `README.md`)
- Extension port → Vault routes: serves capture routes (evidence: `apps/03_ai-assistant/src/main/extension/server.ts`)
- Browser extension → Extension port: sends captures (evidence: `README.md`)
