# chevey339/kelivo architecture

> Architecture diagram of the GitHub repository chevey339/kelivo, 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/chevey339/kelivo
- Repository: https://github.com/chevey339/kelivo

## Overview

Kelivo is a cross-platform Flutter LLM client. Its primary workflow is to configure a model provider, start a conversation, and optionally let the model use search, tools, memory, or a bound workspace before returning a result. The README documents those product stages and local-first storage; the supplied tree and excerpts mainly expose native platform services, not the Flutter/Dart implementation, so undocumented internal links are omitted. Native code shown supports background generation, scheduled tasks, device tools, and incoming-share handling.

Main entry points: [`android/app/src/main/kotlin/com/psyche/kelivo/workspace`](https://github.com/chevey339/kelivo/tree/master/android/app/src/main/kotlin/com/psyche/kelivo/workspace) (Workspace tools), [`ios/IncomingShare/IosIncomingShareHandler.swift`](https://github.com/chevey339/kelivo/blob/master/ios/IncomingShare/IosIncomingShareHandler.swift) (Incoming shares), [`android/app/src/main/kotlin/com/psyche/kelivo/background/BackgroundRuntime.kt`](https://github.com/chevey339/kelivo/blob/master/android/app/src/main/kotlin/com/psyche/kelivo/background/BackgroundRuntime.kt) (Background generation), [`android/app/src/main/kotlin/com/psyche/kelivo/scheduled/ScheduledTasks.kt`](https://github.com/chevey339/kelivo/blob/master/android/app/src/main/kotlin/com/psyche/kelivo/scheduled/ScheduledTasks.kt) (Scheduled tasks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_conversation["Conversation and models"]
  node_provider_setup["Provider setup"]
  node_provider["Model providers"]
  node_conversation_ui["Conversation"]
  node_response["Assistant response"]
end

subgraph group_agent["Agent capabilities"]
  node_web_search["Web search"]
  node_mcp["MCP servers"]
  node_skills_memory["Skills and memory"]
  node_workspace["Workspace tools"]
  node_linux_sandbox["Mobile Linux sandbox"]
  node_native_shell["Desktop native shell"]
end

subgraph group_local["Local data"]
  node_local_data[("Local conversations and settings")]
  node_backup{{"WebDAV or S3 backup"}}
end

subgraph group_platform["Platform services"]
  node_background_generation["Background generation"]
  node_scheduled_tasks["Scheduled tasks<br/>[ScheduledTasks.kt]"]
  node_device_tools["Device-local tools"]
  node_incoming_share["Incoming shares"]
  node_share_inbox[("Share inbox")]
end

node_user(("User"))
node_model_service{{"Model API"}}

node_user -->|"configures"| node_provider_setup
node_provider_setup -->|"adds provider"| node_provider
node_provider -->|"sends requests"| node_model_service
node_user -->|"starts chat"| node_conversation_ui
node_conversation_ui -->|"submits prompt"| node_model_service
node_model_service -->|"returns answer"| node_response
node_conversation_ui -->|"enables search"| node_web_search
node_conversation_ui -->|"enables servers"| node_mcp
node_conversation_ui -->|"uses capabilities"| node_skills_memory
node_conversation_ui -->|"binds workspace"| node_workspace
node_workspace -->|"runs sandbox"| node_linux_sandbox
node_workspace -->|"runs commands"| node_native_shell
node_conversation_ui -->|"stores locally"| node_local_data
node_local_data -->|"backs up"| node_backup
node_user -->|"continues generation"| node_background_generation
node_user -->|"schedules work"| node_scheduled_tasks
node_conversation_ui -->|"calls device tools"| node_device_tools
node_user -->|"shares content"| node_incoming_share
node_incoming_share -->|"saves delivery"| node_share_inbox

click node_workspace "https://github.com/chevey339/kelivo/tree/master/android/app/src/main/kotlin/com/psyche/kelivo/workspace"
click node_linux_sandbox "https://github.com/chevey339/kelivo/tree/master/android/app/src/main/kotlin/com/psyche/kelivo/workspace"
click node_background_generation "https://github.com/chevey339/kelivo/blob/master/android/app/src/main/kotlin/com/psyche/kelivo/background/BackgroundRuntime.kt"
click node_scheduled_tasks "https://github.com/chevey339/kelivo/blob/master/android/app/src/main/kotlin/com/psyche/kelivo/scheduled/ScheduledTasks.kt"
click node_device_tools "https://github.com/chevey339/kelivo/blob/master/android/app/src/main/kotlin/com/psyche/kelivo/DeviceLocalToolsHandler.kt"
click node_incoming_share "https://github.com/chevey339/kelivo/blob/master/ios/IncomingShare/IosIncomingShareHandler.swift"
click node_share_inbox "https://github.com/chevey339/kelivo/blob/master/ios/IncomingShare/IncomingShareInbox.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_provider_setup,node_provider,node_conversation_ui,node_response,node_user toneBlue
class node_web_search,node_mcp,node_skills_memory,node_workspace,node_linux_sandbox,node_native_shell toneAmber
class node_local_data,node_backup,node_model_service toneMint
class node_background_generation,node_scheduled_tasks,node_device_tools,node_incoming_share,node_share_inbox toneRose
```

## Components

### Conversation and models

- **Provider setup**
- **Model providers**
- **Conversation**
- **Assistant response**

### Agent capabilities

- **Web search**
- **MCP servers**
- **Skills and memory**
- [Workspace tools](https://github.com/chevey339/kelivo/tree/master/android/app/src/main/kotlin/com/psyche/kelivo/workspace): `android/app/src/main/kotlin/com/psyche/kelivo/workspace`
- [Mobile Linux sandbox](https://github.com/chevey339/kelivo/tree/master/android/app/src/main/kotlin/com/psyche/kelivo/workspace): `android/app/src/main/kotlin/com/psyche/kelivo/workspace`
- **Desktop native shell**

### Local data

- **Local conversations and settings**
- **WebDAV or S3 backup**

### Platform services

- [Background generation](https://github.com/chevey339/kelivo/blob/master/android/app/src/main/kotlin/com/psyche/kelivo/background/BackgroundRuntime.kt): `android/app/src/main/kotlin/com/psyche/kelivo/background/BackgroundRuntime.kt`
- [Scheduled tasks](https://github.com/chevey339/kelivo/blob/master/android/app/src/main/kotlin/com/psyche/kelivo/scheduled/ScheduledTasks.kt): `android/app/src/main/kotlin/com/psyche/kelivo/scheduled/ScheduledTasks.kt`
- [Device-local tools](https://github.com/chevey339/kelivo/blob/master/android/app/src/main/kotlin/com/psyche/kelivo/DeviceLocalToolsHandler.kt): `android/app/src/main/kotlin/com/psyche/kelivo/DeviceLocalToolsHandler.kt`
- [Incoming shares](https://github.com/chevey339/kelivo/blob/master/ios/IncomingShare/IosIncomingShareHandler.swift): `ios/IncomingShare/IosIncomingShareHandler.swift`
- [Share inbox](https://github.com/chevey339/kelivo/blob/master/ios/IncomingShare/IncomingShareInbox.swift): `ios/IncomingShare/IncomingShareInbox.swift`

### Other components

- **User**
- **Model API**

## Connections

- User → Provider setup: configures
- Provider setup → Model providers: adds provider
- Model providers → Model API: sends requests
- User → Conversation: starts chat
- Conversation → Model API: submits prompt
- Model API → Assistant response: returns answer
- Conversation → Web search: enables search
- Conversation → MCP servers: enables servers
- Conversation → Skills and memory: uses capabilities
- Conversation → Workspace tools: binds workspace
- Workspace tools → Mobile Linux sandbox: runs sandbox
- Workspace tools → Desktop native shell: runs commands
- Conversation → Local conversations and settings: stores locally
- Local conversations and settings → WebDAV or S3 backup: backs up
- User → Background generation: continues generation
- User → Scheduled tasks: schedules work
- Conversation → Device-local tools: calls device tools
- User → Incoming shares: shares content
- Incoming shares → Share inbox: saves delivery (evidence: `ios/IncomingShare/IosIncomingShareHandler.swift`)
