# soumyachk101/ensembyte architecture

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

- Interactive diagram: https://gitdiagram.com/soumyachk101/ensembyte
- Repository: https://github.com/soumyachk101/ensembyte

## Overview

Ensembyte is a local-first, multi-agent coding client, with a macOS Swift app and a Rust desktop stack; the tree also includes an iOS client. The main workflow is to choose a project and agent, compose a request, run it through a local provider adapter, and inspect its streaming transcript and per-turn changes. Other documented capabilities include MCP, spend visibility, and optional session sync. The README describes product behavior, while sampled sources expose only selected Rust, iOS, and Swift internals; dashed links mark relationships not verified in those excerpts.

Main entry points: [`Ensembyte-swift/Ensembyte/App/EnsembyteApp.swift`](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-swift/Ensembyte/App/EnsembyteApp.swift) (macOS app), [`Ensembyte-rust/apps/ensembyte/src/main.rs`](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/apps/ensembyte/src/main.rs) (Desktop app), [`Ensembyte-rust/apps/ios/Ensembyte/Session/SessionViewController.swift`](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/apps/ios/Ensembyte/Session/SessionViewController.swift) (Session view), [`Ensembyte-rust/crates/harness/src/catalog.rs`](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/harness/src/catalog.rs) (Agent adapters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_mac_app["macOS app<br/>[EnsembyteApp.swift]"]
  node_desktop_app["Desktop app<br/>[main.rs]"]
  node_ios_shell["iOS shell"]
  node_session_setup["Session setup"]
  node_session_view["Session view"]
  node_composer["Message composer<br/>[ComposerBar.swift]"]
  node_transcript["Live transcript<br/>[transcript.rs]"]
end

subgraph group_runtime["Agent runtime"]
  node_account_client["Account client<br/>[client.rs]"]
  node_agent_harness["Agent adapters<br/>[catalog.rs]"]
  node_permissions["Permission prompts<br/>[wire.rs]"]
end

subgraph group_work["Workspace tools"]
  node_workspace["Projects and threads<br/>[sessions.rs]"]
  node_change_history["Turn diffs<br/>[diff_sync.rs]"]
  node_mcp["MCP integrations<br/>[tools.rs]"]
  node_usage["Spend and quota<br/>[usage.rs]"]
end

subgraph group_services["Sync and services"]
  node_sync_client["Session sync<br/>[chat_client.rs]"]
  node_sync_store[("Sync state<br/>[store.rs]")]
  node_edge_service["Edge services<br/>[index.ts]"]
  node_swift_storage[("Local storage<br/>[Storage.swift]")]
end

node_user(("User"))
node_local_agent{{"Installed agents"}}

node_user -->|"uses"| node_mac_app
node_user -->|"uses"| node_desktop_app
node_user -.->|"uses"| node_ios_shell
node_ios_shell -->|"opens"| node_session_setup
node_ios_shell -->|"opens"| node_session_view
node_session_setup -->|"embeds"| node_composer
node_session_view -.->|"embeds"| node_composer
node_composer -.->|"sends input"| node_session_view
node_session_view -->|"renders stream"| node_transcript
node_mac_app -.->|"runs agents"| node_agent_harness
node_desktop_app -.->|"starts client"| node_account_client
node_account_client -.->|"dispatches"| node_agent_harness
node_agent_harness -->|"launches"| node_local_agent
node_local_agent -->|"streams output"| node_transcript
node_agent_harness -->|"handles prompts"| node_permissions
node_desktop_app -->|"manages sessions"| node_workspace
node_mac_app -->|"manages sessions"| node_workspace
node_desktop_app -->|"shows turn diffs"| node_change_history
node_mac_app -->|"shows turn diffs"| node_change_history
node_desktop_app -->|"offers tools"| node_mcp
node_mac_app -->|"offers tools"| node_mcp
node_account_client -.->|"tracks usage"| node_usage
node_desktop_app -.->|"syncs sessions"| node_sync_client
node_sync_client -->|"persists updates"| node_sync_store
node_sync_client -.->|"connects remotely"| node_edge_service
node_mac_app -.->|"persists local data"| node_swift_storage

click node_mac_app "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-swift/Ensembyte/App/EnsembyteApp.swift"
click node_desktop_app "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/apps/ensembyte/src/main.rs"
click node_ios_shell "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/apps/ios/Ensembyte/Shell/MainTabController.swift"
click node_session_setup "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/apps/ios/Ensembyte/Session/NewSessionViewController.swift"
click node_session_view "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/apps/ios/Ensembyte/Session/SessionViewController.swift"
click node_composer "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/apps/ios/Ensembyte/Composer/ComposerBar.swift"
click node_transcript "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/ui/src/transcript.rs"
click node_account_client "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/client/src/client.rs"
click node_agent_harness "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/harness/src/catalog.rs"
click node_permissions "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/harness/src/claude/wire.rs"
click node_workspace "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/engine/src/sessions.rs"
click node_change_history "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/engine/src/diff_sync.rs"
click node_mcp "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/mcp/src/tools.rs"
click node_usage "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/engine/src/agent_accounts/usage.rs"
click node_sync_client "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/sync/src/chat_client.rs"
click node_sync_store "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/sync/src/store.rs"
click node_edge_service "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/edge/src/index.ts"
click node_swift_storage "https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-swift/Ensembyte/Services/Store/Storage.swift"

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_mac_app,node_desktop_app,node_ios_shell,node_session_setup,node_session_view,node_composer,node_transcript,node_user toneBlue
class node_account_client,node_agent_harness,node_permissions toneAmber
class node_workspace,node_change_history,node_mcp,node_usage toneMint
class node_sync_client,node_sync_store,node_edge_service,node_swift_storage toneRose
class node_local_agent toneIndigo
```

## Components

### Client experience

- [macOS app](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-swift/Ensembyte/App/EnsembyteApp.swift): `Ensembyte-swift/Ensembyte/App/EnsembyteApp.swift`
- [Desktop app](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/apps/ensembyte/src/main.rs): `Ensembyte-rust/apps/ensembyte/src/main.rs`
- [iOS shell](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/apps/ios/Ensembyte/Shell/MainTabController.swift): `Ensembyte-rust/apps/ios/Ensembyte/Shell/MainTabController.swift`
- [Session setup](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/apps/ios/Ensembyte/Session/NewSessionViewController.swift): `Ensembyte-rust/apps/ios/Ensembyte/Session/NewSessionViewController.swift`
- [Session view](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/apps/ios/Ensembyte/Session/SessionViewController.swift): `Ensembyte-rust/apps/ios/Ensembyte/Session/SessionViewController.swift`
- [Message composer](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/apps/ios/Ensembyte/Composer/ComposerBar.swift): `Ensembyte-rust/apps/ios/Ensembyte/Composer/ComposerBar.swift`
- [Live transcript](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/ui/src/transcript.rs): `Ensembyte-rust/crates/ui/src/transcript.rs`

### Agent runtime

- [Account client](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/client/src/client.rs): `Ensembyte-rust/crates/client/src/client.rs`
- [Agent adapters](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/harness/src/catalog.rs): `Ensembyte-rust/crates/harness/src/catalog.rs`
- [Permission prompts](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/harness/src/claude/wire.rs): `Ensembyte-rust/crates/harness/src/claude/wire.rs`

### Workspace tools

- [Projects and threads](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/engine/src/sessions.rs): `Ensembyte-rust/crates/engine/src/sessions.rs`
- [Turn diffs](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/engine/src/diff_sync.rs): `Ensembyte-rust/crates/engine/src/diff_sync.rs`
- [MCP integrations](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/mcp/src/tools.rs): `Ensembyte-rust/crates/mcp/src/tools.rs`
- [Spend and quota](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/engine/src/agent_accounts/usage.rs): `Ensembyte-rust/crates/engine/src/agent_accounts/usage.rs`

### Sync and services

- [Session sync](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/sync/src/chat_client.rs): `Ensembyte-rust/crates/sync/src/chat_client.rs`
- [Sync state](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/crates/sync/src/store.rs): `Ensembyte-rust/crates/sync/src/store.rs`
- [Edge services](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-rust/edge/src/index.ts): `Ensembyte-rust/edge/src/index.ts`
- [Local storage](https://github.com/soumyachk101/ensembyte/blob/main/Ensembyte-swift/Ensembyte/Services/Store/Storage.swift): `Ensembyte-swift/Ensembyte/Services/Store/Storage.swift`

### Other components

- **User**
- **Installed agents**

## Connections

- User → macOS app: uses (evidence: `README.md`)
- User → Desktop app: uses (evidence: `README.md`)
- User → iOS shell: uses
- iOS shell → Session setup: opens (evidence: `Ensembyte-rust/apps/ios/Ensembyte/Shell/MainTabController.swift`)
- iOS shell → Session view: opens (evidence: `Ensembyte-rust/apps/ios/Ensembyte/Shell/MainTabController.swift`)
- Session setup → Message composer: embeds (evidence: `Ensembyte-rust/apps/ios/Ensembyte/Session/NewSessionViewController.swift`)
- Session view → Message composer: embeds (evidence: `Ensembyte-rust/apps/ios/Ensembyte/Session/SessionViewController.swift`)
- Message composer → Session view: sends input (evidence: `Ensembyte-rust/apps/ios/Ensembyte/Session/SessionViewController.swift`)
- Session view → Live transcript: renders stream
- macOS app → Agent adapters: runs agents
- Desktop app → Account client: starts client
- Account client → Agent adapters: dispatches
- Agent adapters → Installed agents: launches (evidence: `README.md`)
- Installed agents → Live transcript: streams output (evidence: `README.md`)
- Agent adapters → Permission prompts: handles prompts (evidence: `README.md`)
- Desktop app → Projects and threads: manages sessions (evidence: `README.md`)
- macOS app → Projects and threads: manages sessions (evidence: `README.md`)
- Desktop app → Turn diffs: shows turn diffs (evidence: `README.md`)
- macOS app → Turn diffs: shows turn diffs (evidence: `README.md`)
- Desktop app → MCP integrations: offers tools (evidence: `README.md`)
- macOS app → MCP integrations: offers tools (evidence: `README.md`)
- Account client → Spend and quota: tracks usage
- Desktop app → Session sync: syncs sessions
- Session sync → Sync state: persists updates (evidence: `Ensembyte-rust/crates/sync/src/chat_client.rs`)
- Session sync → Edge services: connects remotely
- macOS app → Local storage: persists local data
