# orgoai/bops architecture

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

- Interactive diagram: https://gitdiagram.com/orgoai/bops
- Repository: https://github.com/orgoai/bops

## Overview

Bops is a Mac-hosted AI team for business operations. A user asks a bot in chat or a connected channel; the bot coordinates work, uses apps or a cloud computer, and reports results back. The graph highlights that execution path and documented capabilities including live screen control, approvals, memory, scheduled watches, and phone/email access. Source excerpts show session orchestration, screen access, persistence, and the Mac-to-cloud protocol; other capability links are based on the README rather than inspected implementation.

Main entry points: [`lib/server/sessions.ts`](https://github.com/orgoai/bops/blob/main/lib/server/sessions.ts) (Task orchestration), [`lib/server/screens.ts`](https://github.com/orgoai/bops/blob/main/lib/server/screens.ts) (Live screens), [`lib/server/store.ts`](https://github.com/orgoai/bops/blob/main/lib/server/store.ts) (State store), [`app/api/account/route.ts`](https://github.com/orgoai/bops/blob/main/app/api/account/route.ts) (Plans and usage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_chat["Chat interface<br/>[chat-view.tsx]"]
  node_session_api["Session endpoints<br/>[route.ts]"]
end

subgraph group_execution["Bot execution"]
  node_session_engine["Task orchestration<br/>[sessions.ts]"]
  node_bot_team["Bot team<br/>[bots.ts]"]
  node_memory["Workspace memory<br/>[memory.ts]"]
  node_approvals["App approvals<br/>[route.ts]"]
end

subgraph group_computer["Computer access"]
  node_computer_api["Computer controls<br/>[route.ts]"]
  node_local_computer["Mac execution<br/>[local.ts]"]
  node_orgo["Cloud computers<br/>[orgo.ts]"]
  node_screens["Live screens<br/>[screens.ts]"]
  node_screen_watch["Screen watches<br/>[screen-watch.ts]"]
end

subgraph group_integrations["Channels and integrations"]
  node_apps_ui["Connected apps<br/>[apps.tsx]"]
  node_composio["App integrations<br/>[composio.ts]"]
  node_channels["Team channels<br/>[channels.ts]"]
  node_slack["Slack events<br/>[route.ts]"]
  node_mail["Bot email<br/>[mail.ts]"]
  node_phone["Bot phone<br/>[phone.ts]"]
end

subgraph group_platform["Account and platform"]
  node_state_store["State store<br/>[store.ts]"]
  node_persistence["Persistence backends<br/>[persist.ts]"]
  node_cloud_client["Cloud client<br/>[cloud.ts]"]
  node_cloud_service["Bops Cloud<br/>[server.ts]"]
  node_cloud_db[("Cloud database<br/>[db.ts]")]
  node_account["Plans and usage<br/>[route.ts]"]
end

node_owner(("User"))
node_orgo_service["Orgo platform"]

node_owner -->|"requests work"| node_chat
node_chat -.->|"submits task"| node_session_api
node_session_api -.->|"dispatches"| node_session_engine
node_session_engine -->|"coordinates bots"| node_bot_team
node_session_engine -->|"loads context"| node_memory
node_session_engine -->|"reads screens"| node_screens
node_session_engine -->|"requests approval"| node_approvals
node_session_engine -->|"executes tasks"| node_local_computer
node_session_engine -->|"uses computers"| node_orgo
node_computer_api -->|"controls computer"| node_local_computer
node_computer_api -->|"reads screen state"| node_screens
node_screens -->|"lists screens"| node_orgo
node_owner -->|"watches or takes over"| node_screens
node_screen_watch -->|"monitors screens"| node_screens
node_owner -->|"connects apps"| node_apps_ui
node_apps_ui -.->|"configures access"| node_composio
node_owner -->|"sends requests"| node_channels
node_slack -.->|"delivers events"| node_channels
node_owner -->|"emails tasks"| node_mail
node_owner -->|"calls or texts"| node_phone
node_session_engine -->|"uses session state"| node_state_store
node_state_store -->|"persists state"| node_persistence
node_state_store -->|"uses cloud store"| node_cloud_client
node_cloud_client -->|"exchanges protocol"| node_cloud_service
node_cloud_service -.->|"uses database"| node_cloud_db
node_owner -->|"manages plan"| node_account
node_account -->|"reads account state"| node_state_store
node_account -->|"checks billing"| node_orgo_service
node_orgo -.->|"provisions computers"| node_orgo_service

click node_chat "https://github.com/orgoai/bops/blob/main/components/app/chat-view.tsx"
click node_session_api "https://github.com/orgoai/bops/blob/main/app/api/sessions/route.ts"
click node_session_engine "https://github.com/orgoai/bops/blob/main/lib/server/sessions.ts"
click node_bot_team "https://github.com/orgoai/bops/blob/main/lib/server/bots.ts"
click node_memory "https://github.com/orgoai/bops/blob/main/lib/server/memory.ts"
click node_approvals "https://github.com/orgoai/bops/blob/main/app/api/apps/approvals/route.ts"
click node_computer_api "https://github.com/orgoai/bops/blob/main/app/api/computer/route.ts"
click node_local_computer "https://github.com/orgoai/bops/blob/main/lib/server/local.ts"
click node_orgo "https://github.com/orgoai/bops/blob/main/lib/server/orgo.ts"
click node_screens "https://github.com/orgoai/bops/blob/main/lib/server/screens.ts"
click node_screen_watch "https://github.com/orgoai/bops/blob/main/lib/server/screen-watch.ts"
click node_apps_ui "https://github.com/orgoai/bops/blob/main/components/app/apps.tsx"
click node_composio "https://github.com/orgoai/bops/blob/main/lib/server/composio.ts"
click node_channels "https://github.com/orgoai/bops/blob/main/lib/server/channels.ts"
click node_slack "https://github.com/orgoai/bops/blob/main/app/api/channels/slack/events/route.ts"
click node_mail "https://github.com/orgoai/bops/blob/main/lib/server/mail.ts"
click node_phone "https://github.com/orgoai/bops/blob/main/lib/server/phone.ts"
click node_state_store "https://github.com/orgoai/bops/blob/main/lib/server/store.ts"
click node_persistence "https://github.com/orgoai/bops/blob/main/lib/server/persist.ts"
click node_cloud_client "https://github.com/orgoai/bops/blob/main/lib/server/cloud.ts"
click node_cloud_service "https://github.com/orgoai/bops/blob/main/cloud/server.ts"
click node_cloud_db "https://github.com/orgoai/bops/blob/main/cloud/db.ts"
click node_account "https://github.com/orgoai/bops/blob/main/app/api/account/route.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_chat,node_session_api,node_owner toneBlue
class node_session_engine,node_bot_team,node_memory,node_approvals toneAmber
class node_computer_api,node_local_computer,node_orgo,node_screens,node_screen_watch toneMint
class node_apps_ui,node_composio,node_channels,node_slack,node_mail,node_phone toneRose
class node_state_store,node_persistence,node_cloud_client,node_cloud_service,node_cloud_db,node_account,node_orgo_service toneIndigo
```

## Components

### User experience

- [Chat interface](https://github.com/orgoai/bops/blob/main/components/app/chat-view.tsx): `components/app/chat-view.tsx`
- [Session endpoints](https://github.com/orgoai/bops/blob/main/app/api/sessions/route.ts): `app/api/sessions/route.ts`

### Bot execution

- [Task orchestration](https://github.com/orgoai/bops/blob/main/lib/server/sessions.ts): `lib/server/sessions.ts`
- [Bot team](https://github.com/orgoai/bops/blob/main/lib/server/bots.ts): `lib/server/bots.ts`
- [Workspace memory](https://github.com/orgoai/bops/blob/main/lib/server/memory.ts): `lib/server/memory.ts`
- [App approvals](https://github.com/orgoai/bops/blob/main/app/api/apps/approvals/route.ts): `app/api/apps/approvals/route.ts`

### Computer access

- [Computer controls](https://github.com/orgoai/bops/blob/main/app/api/computer/route.ts): `app/api/computer/route.ts`
- [Mac execution](https://github.com/orgoai/bops/blob/main/lib/server/local.ts): `lib/server/local.ts`
- [Cloud computers](https://github.com/orgoai/bops/blob/main/lib/server/orgo.ts): `lib/server/orgo.ts`
- [Live screens](https://github.com/orgoai/bops/blob/main/lib/server/screens.ts): `lib/server/screens.ts`
- [Screen watches](https://github.com/orgoai/bops/blob/main/lib/server/screen-watch.ts): `lib/server/screen-watch.ts`

### Channels and integrations

- [Connected apps](https://github.com/orgoai/bops/blob/main/components/app/apps.tsx): `components/app/apps.tsx`
- [App integrations](https://github.com/orgoai/bops/blob/main/lib/server/composio.ts): `lib/server/composio.ts`
- [Team channels](https://github.com/orgoai/bops/blob/main/lib/server/channels.ts): `lib/server/channels.ts`
- [Slack events](https://github.com/orgoai/bops/blob/main/app/api/channels/slack/events/route.ts): `app/api/channels/slack/events/route.ts`
- [Bot email](https://github.com/orgoai/bops/blob/main/lib/server/mail.ts): `lib/server/mail.ts`
- [Bot phone](https://github.com/orgoai/bops/blob/main/lib/server/phone.ts): `lib/server/phone.ts`

### Account and platform

- [State store](https://github.com/orgoai/bops/blob/main/lib/server/store.ts): `lib/server/store.ts`
- [Persistence backends](https://github.com/orgoai/bops/blob/main/lib/server/persist.ts): `lib/server/persist.ts`
- [Cloud client](https://github.com/orgoai/bops/blob/main/lib/server/cloud.ts): `lib/server/cloud.ts`
- [Bops Cloud](https://github.com/orgoai/bops/blob/main/cloud/server.ts): `cloud/server.ts`
- [Cloud database](https://github.com/orgoai/bops/blob/main/cloud/db.ts): `cloud/db.ts`
- [Plans and usage](https://github.com/orgoai/bops/blob/main/app/api/account/route.ts): `app/api/account/route.ts`

### Other components

- **User**
- **Orgo platform**

## Connections

- User → Chat interface: requests work (evidence: `README.md`)
- Chat interface → Session endpoints: submits task
- Session endpoints → Task orchestration: dispatches
- Task orchestration → Bot team: coordinates bots (evidence: `README.md`)
- Task orchestration → Workspace memory: loads context (evidence: `lib/server/sessions.ts`)
- Task orchestration → Live screens: reads screens (evidence: `lib/server/sessions.ts`)
- Task orchestration → App approvals: requests approval (evidence: `README.md`)
- Task orchestration → Mac execution: executes tasks (evidence: `README.md`)
- Task orchestration → Cloud computers: uses computers (evidence: `README.md`)
- Computer controls → Mac execution: controls computer (evidence: `app/api/computer/route.ts`)
- Computer controls → Live screens: reads screen state (evidence: `app/api/computer/route.ts`)
- Live screens → Cloud computers: lists screens (evidence: `lib/server/screens.ts`)
- User → Live screens: watches or takes over (evidence: `README.md`)
- Screen watches → Live screens: monitors screens (evidence: `README.md`)
- User → Connected apps: connects apps (evidence: `README.md`)
- Connected apps → App integrations: configures access
- User → Team channels: sends requests (evidence: `README.md`)
- Slack events → Team channels: delivers events
- User → Bot email: emails tasks (evidence: `README.md`)
- User → Bot phone: calls or texts (evidence: `README.md`)
- Task orchestration → State store: uses session state (evidence: `lib/server/sessions.ts`)
- State store → Persistence backends: persists state (evidence: `lib/server/store.ts`)
- State store → Cloud client: uses cloud store (evidence: `lib/server/store.ts`)
- Cloud client → Bops Cloud: exchanges protocol
- Bops Cloud → Cloud database: uses database (evidence: `cloud/server.ts`)
- User → Plans and usage: manages plan (evidence: `README.md`)
- Plans and usage → State store: reads account state (evidence: `app/api/account/route.ts`)
- Plans and usage → Orgo platform: checks billing (evidence: `app/api/account/route.ts`)
- Cloud computers → Orgo platform: provisions computers
