# sailry/sailry-harness architecture

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

- Interactive diagram: https://gitdiagram.com/sailry/sailry-harness
- Repository: https://github.com/sailry/sailry-harness

## Overview

Sailry is a self-hosted AI harness: a user starts or resumes work from the desktop or phone, which controls a Host running agents beside project files and data. The Host coordinates model-provider calls and tools; conversation results and approval requests are surfaced back to the controlling app. The graph also preserves documented coding, knowledge, collaboration, connector, plugin, and local-inference capabilities. Relationships are based on the README and the shown entry-point/source-index references; several feature modules were not sampled, so their internal call paths are not asserted.

Main entry points: [`internal/node`](https://github.com/sailry/sailry-harness/tree/main/internal/node) (Agent Runtime), [`internal/desktop/application/run.go`](https://github.com/sailry/sailry-harness/blob/main/internal/desktop/application/run.go) (Desktop App), [`internal/mobile/routes.go`](https://github.com/sailry/sailry-harness/blob/main/internal/mobile/routes.go) (Mobile App), [`internal/link`](https://github.com/sailry/sailry-harness/tree/main/internal/link) (Encrypted Peer Links)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User Clients"]
  node_desktop["Desktop App<br/>[run.go]"]
  node_phone["Mobile App<br/>[routes.go]"]
  node_client_api["Client API<br/>[client.go]"]
end

subgraph group_connectivity["Host Connectivity"]
  node_peer_links["Encrypted Peer Links"]
  node_host_service["Host Service<br/>[main.go]"]
end

subgraph group_agent_work["Agent Work"]
  node_agent["Agent Runtime"]
  node_conversation["Conversation and Sessions<br/>[conversation.go]"]
  node_providers["Model Providers"]
end

subgraph group_capabilities["Tools and Extensions"]
  node_workspaces["Projects and Workspaces<br/>[workspaces.go]"]
  node_coding_tools["Coding Tools<br/>[service.go]"]
  node_databases["Database Tools<br/>[databases.go]"]
  node_ssh["SSH and SFTP<br/>[sftp.go]"]
  node_connectors["External Connectors"]
  node_team_mode["Agent Teams"]
  node_plugin_runtime["Plugin Runtime"]
end

subgraph group_state_models["State and Models"]
  node_knowledge["Knowledge Search<br/>[storage.go]"]
  node_persistent_store[("Host Data Store")]
  node_local_models["Local Inference<br/>[engine.go]"]
  node_speech_ocr["Speech and OCR<br/>[engine.go]"]
end

node_user(("User"))

node_user -->|"starts work"| node_desktop
node_user -->|"controls remotely"| node_phone
node_desktop -->|"connects over"| node_peer_links
node_phone -->|"connects over"| node_peer_links
node_desktop -->|"uses client"| node_client_api
node_phone -->|"uses client"| node_client_api
node_client_api -->|"routes requests"| node_peer_links
node_peer_links -->|"reaches Host"| node_host_service
node_host_service -->|"starts runtime"| node_agent
node_agent -->|"calls chosen models"| node_providers
node_agent -->|"works beside project data"| node_workspaces
node_agent -->|"uses coding tools"| node_coding_tools
node_agent -->|"uses database tools"| node_databases
node_agent -->|"uses remote tools"| node_ssh
node_agent -->|"searches knowledge"| node_knowledge
node_knowledge -->|"reads and indexes values"| node_persistent_store
node_agent -->|"fans out subagents"| node_team_mode
node_agent -.->|"uses integrations"| node_connectors
node_desktop -->|"renders plugin UI"| node_plugin_runtime
node_agent -->|"supports plugin tools"| node_plugin_runtime
node_agent -->|"runs local inference"| node_local_models
node_agent -->|"uses local recognition"| node_speech_ocr
node_agent -->|"produces visible steps"| node_conversation
node_conversation -.->|"surfaces results"| node_desktop
node_conversation -->|"surfaces session updates"| node_phone

click node_desktop "https://github.com/sailry/sailry-harness/blob/main/internal/desktop/application/run.go"
click node_phone "https://github.com/sailry/sailry-harness/blob/main/internal/mobile/routes.go"
click node_client_api "https://github.com/sailry/sailry-harness/blob/main/internal/client/client.go"
click node_peer_links "https://github.com/sailry/sailry-harness/tree/main/internal/link"
click node_host_service "https://github.com/sailry/sailry-harness/blob/main/cmd/sailry-host/main.go"
click node_agent "https://github.com/sailry/sailry-harness/tree/main/internal/node"
click node_conversation "https://github.com/sailry/sailry-harness/blob/main/internal/desktop/live/conversation.go"
click node_providers "https://github.com/sailry/sailry-harness/tree/main/modules/providers/desktop"
click node_workspaces "https://github.com/sailry/sailry-harness/blob/main/internal/core/workspaces.go"
click node_coding_tools "https://github.com/sailry/sailry-harness/blob/main/modules/code-index/node/service.go"
click node_databases "https://github.com/sailry/sailry-harness/blob/main/internal/databases/databases.go"
click node_ssh "https://github.com/sailry/sailry-harness/blob/main/internal/ssh/sftp.go"
click node_connectors "https://github.com/sailry/sailry-harness/tree/main/modules/connectors/desktop"
click node_team_mode "https://github.com/sailry/sailry-harness/tree/main/modules/teams/desktop"
click node_plugin_runtime "https://github.com/sailry/sailry-harness/tree/main/internal/desktop/plugins"
click node_knowledge "https://github.com/sailry/sailry-harness/blob/main/internal/node/knowledge/service/storage.go"
click node_persistent_store "https://github.com/sailry/sailry-harness/blob/main/internal/node/store/knowledge_storage.go"
click node_local_models "https://github.com/sailry/sailry-harness/blob/main/internal/localmodels/decision/engine.go"
click node_speech_ocr "https://github.com/sailry/sailry-harness/blob/main/internal/localmodels/ocr/engine.go"

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_desktop,node_phone,node_client_api,node_user toneBlue
class node_peer_links,node_host_service toneAmber
class node_agent,node_conversation,node_providers toneMint
class node_workspaces,node_coding_tools,node_databases,node_ssh,node_connectors,node_team_mode,node_plugin_runtime toneRose
class node_knowledge,node_persistent_store,node_local_models,node_speech_ocr toneIndigo
```

## Components

### User Clients

- [Desktop App](https://github.com/sailry/sailry-harness/blob/main/internal/desktop/application/run.go): `internal/desktop/application/run.go`
- [Mobile App](https://github.com/sailry/sailry-harness/blob/main/internal/mobile/routes.go): `internal/mobile/routes.go`
- [Client API](https://github.com/sailry/sailry-harness/blob/main/internal/client/client.go): `internal/client/client.go`

### Host Connectivity

- [Encrypted Peer Links](https://github.com/sailry/sailry-harness/tree/main/internal/link): `internal/link`
- [Host Service](https://github.com/sailry/sailry-harness/blob/main/cmd/sailry-host/main.go): `cmd/sailry-host/main.go`

### Agent Work

- [Agent Runtime](https://github.com/sailry/sailry-harness/tree/main/internal/node): `internal/node`
- [Conversation and Sessions](https://github.com/sailry/sailry-harness/blob/main/internal/desktop/live/conversation.go): `internal/desktop/live/conversation.go`
- [Model Providers](https://github.com/sailry/sailry-harness/tree/main/modules/providers/desktop): `modules/providers/desktop`

### Tools and Extensions

- [Projects and Workspaces](https://github.com/sailry/sailry-harness/blob/main/internal/core/workspaces.go): `internal/core/workspaces.go`
- [Coding Tools](https://github.com/sailry/sailry-harness/blob/main/modules/code-index/node/service.go): `modules/code-index/node/service.go`
- [Database Tools](https://github.com/sailry/sailry-harness/blob/main/internal/databases/databases.go): `internal/databases/databases.go`
- [SSH and SFTP](https://github.com/sailry/sailry-harness/blob/main/internal/ssh/sftp.go): `internal/ssh/sftp.go`
- [External Connectors](https://github.com/sailry/sailry-harness/tree/main/modules/connectors/desktop): `modules/connectors/desktop`
- [Agent Teams](https://github.com/sailry/sailry-harness/tree/main/modules/teams/desktop): `modules/teams/desktop`
- [Plugin Runtime](https://github.com/sailry/sailry-harness/tree/main/internal/desktop/plugins): `internal/desktop/plugins`

### State and Models

- [Knowledge Search](https://github.com/sailry/sailry-harness/blob/main/internal/node/knowledge/service/storage.go): `internal/node/knowledge/service/storage.go`
- [Host Data Store](https://github.com/sailry/sailry-harness/blob/main/internal/node/store/knowledge_storage.go): `internal/node/store/knowledge_storage.go`
- [Local Inference](https://github.com/sailry/sailry-harness/blob/main/internal/localmodels/decision/engine.go): `internal/localmodels/decision/engine.go`
- [Speech and OCR](https://github.com/sailry/sailry-harness/blob/main/internal/localmodels/ocr/engine.go): `internal/localmodels/ocr/engine.go`

### Other components

- **User**

## Connections

- User → Desktop App: starts work
- User → Mobile App: controls remotely
- Desktop App → Encrypted Peer Links: connects over
- Mobile App → Encrypted Peer Links: connects over (evidence: `internal/mobile/routes.go`)
- Desktop App → Client API: uses client
- Mobile App → Client API: uses client (evidence: `internal/mobile/routes.go`)
- Client API → Encrypted Peer Links: routes requests (evidence: `internal/client/client.go`)
- Encrypted Peer Links → Host Service: reaches Host (evidence: `cmd/sailry-host/main.go`)
- Host Service → Agent Runtime: starts runtime (evidence: `cmd/sailry-host/main.go`)
- Agent Runtime → Model Providers: calls chosen models
- Agent Runtime → Projects and Workspaces: works beside project data
- Agent Runtime → Coding Tools: uses coding tools (evidence: `modules/code-index/node/service.go`)
- Agent Runtime → Database Tools: uses database tools
- Agent Runtime → SSH and SFTP: uses remote tools
- Agent Runtime → Knowledge Search: searches knowledge (evidence: `internal/node/knowledge/service/storage.go`)
- Knowledge Search → Host Data Store: reads and indexes values (evidence: `internal/node/knowledge/service/storage.go`)
- Agent Runtime → Agent Teams: fans out subagents
- Agent Runtime → External Connectors: uses integrations
- Desktop App → Plugin Runtime: renders plugin UI
- Agent Runtime → Plugin Runtime: supports plugin tools (evidence: `internal/desktop/plugins/cmd/desktop-spike/main.go`)
- Agent Runtime → Local Inference: runs local inference
- Agent Runtime → Speech and OCR: uses local recognition
- Agent Runtime → Conversation and Sessions: produces visible steps
- Conversation and Sessions → Desktop App: surfaces results
- Conversation and Sessions → Mobile App: surfaces session updates
