# godilman/agentbits architecture

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

- Interactive diagram: https://gitdiagram.com/godilman/agentbits
- Repository: https://github.com/godilman/agentbits

## Overview

Agentbits is a local-first desktop workspace for coordinating AI-agent teams. A user configures an organization and project, chats with its lead, and explicitly starts work; the lead delegates tasks, agents run them, and the lead reviews results. The app also provides project and personal memory, files, connections, skills, terminals, and live work views. The graph combines documented workflows with relationships visible in sampled source; unsampled UI and IPC wiring is not inferred.

Main entry points: [`src/main/core/orchestrator.ts`](https://github.com/godilman/agentbits/blob/main/src/main/core/orchestrator.ts) (Task orchestration), [`src/main/files/service.ts`](https://github.com/godilman/agentbits/blob/main/src/main/files/service.ts) (File handling), [`src/main/db/repos.ts`](https://github.com/godilman/agentbits/blob/main/src/main/db/repos.ts) (Data repositories), [`src/renderer/src/App.tsx`](https://github.com/godilman/agentbits/blob/main/src/renderer/src/App.tsx) (Workspace UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Desktop workspace"]
  node_app["Desktop shell<br/>[index.ts]"]
  node_renderer["Workspace UI<br/>[App.tsx]"]
  node_ipc["IPC bridge<br/>[ipc.ts]"]
  node_preload["Preload API<br/>[index.ts]"]
  node_office["Live office<br/>[engine.ts]"]
  node_events["Event broadcast<br/>[events.ts]"]
end

subgraph group_coordination["Team coordination"]
  node_org["Agent organization<br/>[org.ts]"]
  node_orchestrator["Task orchestration<br/>[orchestrator.ts]"]
  node_tasksui["Task board<br/>[TasksView.tsx]"]
  node_chatui["Lead chat<br/>[ChatView.tsx]"]
end

subgraph group_capabilities["Agent capabilities"]
  node_projectmemory["Project memory<br/>[service.ts]"]
  node_memory["Memory search<br/>[memory.ts]"]
  node_files["File handling<br/>[service.ts]"]
  node_skills["Agent skills<br/>[service.ts]"]
  node_terminal["Agent terminals<br/>[manager.ts]"]
end

subgraph group_persistence["Local data"]
  node_database[("SQLite database<br/>[index.ts]")]
  node_repositories["Data repositories<br/>[repos.ts]"]
end

subgraph group_integrations["External integrations"]
  node_providers["AI providers"]
  node_connections["Connections<br/>[service.ts]"]
  node_apps["Agent apps<br/>[service.ts]"]
end

node_user(("User"))

node_user -->|"uses"| node_renderer
node_renderer -.->|"requests through"| node_preload
node_preload -.->|"bridges requests"| node_ipc
node_app -->|"registers"| node_ipc
node_app -->|"initializes"| node_orchestrator
node_user -->|"configures"| node_org
node_user -->|"describes goal"| node_chatui
node_chatui -.->|"submits work"| node_orchestrator
node_orchestrator -->|"runs agents with"| node_providers
node_orchestrator -->|"updates task work"| node_tasksui
node_orchestrator -->|"uses"| node_projectmemory
node_orchestrator -->|"uses tools from"| node_connections
node_orchestrator -->|"uses tools from"| node_apps
node_orchestrator -->|"uses"| node_skills
node_orchestrator -->|"uses"| node_files
node_orchestrator -->|"reads and writes"| node_database
node_orchestrator -->|"publishes"| node_events
node_org -->|"uses"| node_repositories
node_repositories -->|"queries"| node_database
node_files -->|"uses"| node_repositories
node_files -->|"stores file data"| node_database
node_projectmemory -->|"uses"| node_repositories
node_terminal -->|"emits terminal events"| node_events
node_events -->|"broadcasts events"| node_renderer
node_user -->|"tracks and reviews"| node_tasksui
node_user -->|"watches agents"| node_office
node_user -->|"attaches files"| node_files
node_user -->|"searches memories"| node_memory
node_user -->|"interacts with agents"| node_terminal

click node_app "https://github.com/godilman/agentbits/blob/main/src/main/index.ts"
click node_renderer "https://github.com/godilman/agentbits/blob/main/src/renderer/src/App.tsx"
click node_ipc "https://github.com/godilman/agentbits/blob/main/src/main/ipc.ts"
click node_preload "https://github.com/godilman/agentbits/blob/main/src/preload/index.ts"
click node_org "https://github.com/godilman/agentbits/blob/main/src/main/core/org.ts"
click node_orchestrator "https://github.com/godilman/agentbits/blob/main/src/main/core/orchestrator.ts"
click node_tasksui "https://github.com/godilman/agentbits/blob/main/src/renderer/src/features/tasks/TasksView.tsx"
click node_chatui "https://github.com/godilman/agentbits/blob/main/src/renderer/src/features/chat/ChatView.tsx"
click node_office "https://github.com/godilman/agentbits/blob/main/src/renderer/src/features/office/engine.ts"
click node_providers "https://github.com/godilman/agentbits/tree/main/src/main/providers"
click node_projectmemory "https://github.com/godilman/agentbits/blob/main/src/main/projectMemory/service.ts"
click node_memory "https://github.com/godilman/agentbits/blob/main/src/main/core/memory.ts"
click node_files "https://github.com/godilman/agentbits/blob/main/src/main/files/service.ts"
click node_connections "https://github.com/godilman/agentbits/blob/main/src/main/connections/service.ts"
click node_apps "https://github.com/godilman/agentbits/blob/main/src/main/apps/service.ts"
click node_skills "https://github.com/godilman/agentbits/blob/main/src/main/skills/service.ts"
click node_terminal "https://github.com/godilman/agentbits/blob/main/src/main/terminal/manager.ts"
click node_database "https://github.com/godilman/agentbits/blob/main/src/main/db/index.ts"
click node_repositories "https://github.com/godilman/agentbits/blob/main/src/main/db/repos.ts"
click node_events "https://github.com/godilman/agentbits/blob/main/src/main/events.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_app,node_renderer,node_ipc,node_preload,node_office,node_events,node_user toneBlue
class node_org,node_orchestrator,node_tasksui,node_chatui toneAmber
class node_projectmemory,node_memory,node_files,node_skills,node_terminal toneMint
class node_database,node_repositories toneRose
class node_providers,node_connections,node_apps toneIndigo
```

## Components

### Desktop workspace

- [Desktop shell](https://github.com/godilman/agentbits/blob/main/src/main/index.ts): `src/main/index.ts`
- [Workspace UI](https://github.com/godilman/agentbits/blob/main/src/renderer/src/App.tsx): `src/renderer/src/App.tsx`
- [IPC bridge](https://github.com/godilman/agentbits/blob/main/src/main/ipc.ts): `src/main/ipc.ts`
- [Preload API](https://github.com/godilman/agentbits/blob/main/src/preload/index.ts): `src/preload/index.ts`
- [Live office](https://github.com/godilman/agentbits/blob/main/src/renderer/src/features/office/engine.ts): `src/renderer/src/features/office/engine.ts`
- [Event broadcast](https://github.com/godilman/agentbits/blob/main/src/main/events.ts): `src/main/events.ts`

### Team coordination

- [Agent organization](https://github.com/godilman/agentbits/blob/main/src/main/core/org.ts): `src/main/core/org.ts`
- [Task orchestration](https://github.com/godilman/agentbits/blob/main/src/main/core/orchestrator.ts): `src/main/core/orchestrator.ts`
- [Task board](https://github.com/godilman/agentbits/blob/main/src/renderer/src/features/tasks/TasksView.tsx): `src/renderer/src/features/tasks/TasksView.tsx`
- [Lead chat](https://github.com/godilman/agentbits/blob/main/src/renderer/src/features/chat/ChatView.tsx): `src/renderer/src/features/chat/ChatView.tsx`

### Agent capabilities

- [Project memory](https://github.com/godilman/agentbits/blob/main/src/main/projectMemory/service.ts): `src/main/projectMemory/service.ts`
- [Memory search](https://github.com/godilman/agentbits/blob/main/src/main/core/memory.ts): `src/main/core/memory.ts`
- [File handling](https://github.com/godilman/agentbits/blob/main/src/main/files/service.ts): `src/main/files/service.ts`
- [Agent skills](https://github.com/godilman/agentbits/blob/main/src/main/skills/service.ts): `src/main/skills/service.ts`
- [Agent terminals](https://github.com/godilman/agentbits/blob/main/src/main/terminal/manager.ts): `src/main/terminal/manager.ts`

### Local data

- [SQLite database](https://github.com/godilman/agentbits/blob/main/src/main/db/index.ts): `src/main/db/index.ts`
- [Data repositories](https://github.com/godilman/agentbits/blob/main/src/main/db/repos.ts): `src/main/db/repos.ts`

### External integrations

- [AI providers](https://github.com/godilman/agentbits/tree/main/src/main/providers): `src/main/providers`
- [Connections](https://github.com/godilman/agentbits/blob/main/src/main/connections/service.ts): `src/main/connections/service.ts`
- [Agent apps](https://github.com/godilman/agentbits/blob/main/src/main/apps/service.ts): `src/main/apps/service.ts`

### Other components

- **User**

## Connections

- User → Workspace UI: uses (evidence: `README.md`)
- Workspace UI → Preload API: requests through
- Preload API → IPC bridge: bridges requests
- Desktop shell → IPC bridge: registers (evidence: `src/main/index.ts`)
- Desktop shell → Task orchestration: initializes (evidence: `src/main/index.ts`)
- User → Agent organization: configures (evidence: `README.md`)
- User → Lead chat: describes goal (evidence: `README.md`)
- Lead chat → Task orchestration: submits work
- Task orchestration → AI providers: runs agents with (evidence: `README.md`)
- Task orchestration → Task board: updates task work (evidence: `README.md`)
- Task orchestration → Project memory: uses (evidence: `src/main/core/orchestrator.ts`)
- Task orchestration → Connections: uses tools from (evidence: `src/main/core/orchestrator.ts`)
- Task orchestration → Agent apps: uses tools from (evidence: `src/main/core/orchestrator.ts`)
- Task orchestration → Agent skills: uses (evidence: `src/main/core/orchestrator.ts`)
- Task orchestration → File handling: uses (evidence: `src/main/core/orchestrator.ts`)
- Task orchestration → SQLite database: reads and writes (evidence: `src/main/core/orchestrator.ts`)
- Task orchestration → Event broadcast: publishes (evidence: `src/main/core/orchestrator.ts`)
- Agent organization → Data repositories: uses (evidence: `src/main/core/org.ts`)
- Data repositories → SQLite database: queries (evidence: `src/main/db/repos.ts`)
- File handling → Data repositories: uses (evidence: `src/main/files/service.ts`)
- File handling → SQLite database: stores file data (evidence: `src/main/files/service.ts`)
- Project memory → Data repositories: uses (evidence: `src/main/projectMemory/service.ts`)
- Agent terminals → Event broadcast: emits terminal events (evidence: `src/main/terminal/manager.ts`)
- Event broadcast → Workspace UI: broadcasts events (evidence: `src/main/events.ts`)
- User → Task board: tracks and reviews (evidence: `README.md`)
- User → Live office: watches agents (evidence: `README.md`)
- User → File handling: attaches files (evidence: `README.md`)
- User → Memory search: searches memories (evidence: `README.md`)
- User → Agent terminals: interacts with agents (evidence: `README.md`)
