# searpro/agora architecture

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

- Interactive diagram: https://gitdiagram.com/searpro/agora
- Repository: https://github.com/searpro/agora

## Overview

Agora is an Android BYOK assistant: users configure a provider and model, send a conversation turn, and receive a locally stored response. Its runtime spans provider requests, conversation persistence, and optional agent capabilities including search/RAG, MCP, scheduled automation, local models, and device/shell control. The README documents these capabilities; sampled code confirms startup/database wiring, semantic-search context construction, embedding workers, and parts of task execution. Other subsystem connections are shown only where README documents them.

Main entry points: [`app/src/main/java/com/newoether/agora/automation/TaskExecutionEngine.kt`](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/automation/TaskExecutionEngine.kt) (Agent execution), [`app/src/main/java/com/newoether/agora/MainActivity.kt`](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/MainActivity.kt) (Android app), [`provider/cloud/src/main/java/com/newoether/agora/api/LlmProvider.kt`](https://github.com/searpro/agora/blob/master/provider/cloud/src/main/java/com/newoether/agora/api/LlmProvider.kt) (Cloud providers), [`provider/cloud/src/main/java/com/newoether/agora/api/HttpClient.kt`](https://github.com/searpro/agora/blob/master/provider/cloud/src/main/java/com/newoether/agora/api/HttpClient.kt) (HTTP transport)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and conversations"]
  node_activity["Android app<br/>[MainActivity.kt]"]
  node_execution["Agent execution"]
end

subgraph group_models["Model providers"]
  node_provider["Cloud providers<br/>[LlmProvider.kt]"]
  node_http["HTTP transport<br/>[HttpClient.kt]"]
  node_localmodel["Local models<br/>[LlamaChatEngine.kt]"]
end

subgraph group_agent["Agent capabilities"]
  node_search["Web search"]
  node_rag["Conversation RAG<br/>[RagManager.kt]"]
  node_embedding["Embedding cache"]
  node_skills["Skills and memory<br/>[SkillManager.kt]"]
  node_mcp["MCP tools"]
  node_automation["Scheduled tasks"]
  node_remote["Remote shell<br/>[RemoteControl.kt]"]
  node_sandbox["Alpine sandbox"]
end

subgraph group_state["Data and persistence"]
  node_conversation["Conversation store"]
  node_database[("Chat database<br/>[ChatDatabase.kt]")]
  node_settings["Settings<br/>[SettingsManager.kt]"]
end

subgraph group_device["Device control"]
  node_phone["Phone control"]
end

node_user(("User"))
node_external{{"Model endpoint"}}

node_user -->|"opens and configures"| node_activity
node_activity -->|"selects provider"| node_settings
node_user -->|"sends turn"| node_execution
node_execution -->|"requests completion"| node_provider
node_provider -.->|"uses transport"| node_http
node_http -->|"sends request"| node_external
node_execution -.->|"runs local model"| node_localmodel
node_execution -->|"stores response"| node_conversation
node_conversation -->|"persists locally"| node_database
node_execution -->|"can invoke"| node_search
node_execution -->|"can retrieve context"| node_rag
node_rag -->|"indexes vectors"| node_embedding
node_execution -->|"can use"| node_skills
node_execution -->|"dispatches tools"| node_mcp
node_automation -.->|"runs tasks"| node_execution
node_execution -->|"can invoke"| node_remote
node_execution -->|"can use"| node_sandbox
node_execution -.->|"can control"| node_phone

click node_activity "https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/MainActivity.kt"
click node_execution "https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/automation/TaskExecutionEngine.kt"
click node_conversation "https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/data/repository/ConversationRepository.kt"
click node_database "https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/data/local/ChatDatabase.kt"
click node_settings "https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/data/SettingsManager.kt"
click node_provider "https://github.com/searpro/agora/blob/master/provider/cloud/src/main/java/com/newoether/agora/api/LlmProvider.kt"
click node_http "https://github.com/searpro/agora/blob/master/provider/cloud/src/main/java/com/newoether/agora/api/HttpClient.kt"
click node_localmodel "https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/api/LlamaChatEngine.kt"
click node_search "https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/api/DuckDuckGoScraper.kt"
click node_rag "https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/viewmodel/RagManager.kt"
click node_embedding "https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/service/EmbeddingCacheWorker.kt"
click node_skills "https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/data/SkillManager.kt"
click node_mcp "https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/mcp/McpProtocolClient.kt"
click node_automation "https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/automation/AutomationScheduler.kt"
click node_remote "https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/remote/RemoteControl.kt"
click node_sandbox "https://github.com/searpro/agora/blob/master/app/src/fdroid/java/com/newoether/agora/sandbox/ProotSandboxManager.kt"
click node_phone "https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/phone/PhoneToolProvider.kt"

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_activity,node_execution,node_user toneBlue
class node_provider,node_http,node_localmodel toneAmber
class node_search,node_rag,node_embedding,node_skills,node_mcp,node_automation,node_remote,node_sandbox toneMint
class node_conversation,node_database,node_settings toneRose
class node_phone,node_external toneIndigo
```

## Components

### App and conversations

- [Android app](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/MainActivity.kt): `app/src/main/java/com/newoether/agora/MainActivity.kt`
- [Agent execution](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/automation/TaskExecutionEngine.kt): `app/src/main/java/com/newoether/agora/automation/TaskExecutionEngine.kt`

### Model providers

- [Cloud providers](https://github.com/searpro/agora/blob/master/provider/cloud/src/main/java/com/newoether/agora/api/LlmProvider.kt): `provider/cloud/src/main/java/com/newoether/agora/api/LlmProvider.kt`
- [HTTP transport](https://github.com/searpro/agora/blob/master/provider/cloud/src/main/java/com/newoether/agora/api/HttpClient.kt): `provider/cloud/src/main/java/com/newoether/agora/api/HttpClient.kt`
- [Local models](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/api/LlamaChatEngine.kt): `app/src/main/java/com/newoether/agora/api/LlamaChatEngine.kt`

### Agent capabilities

- [Web search](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/api/DuckDuckGoScraper.kt): `app/src/main/java/com/newoether/agora/api/DuckDuckGoScraper.kt`
- [Conversation RAG](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/viewmodel/RagManager.kt): `app/src/main/java/com/newoether/agora/viewmodel/RagManager.kt`
- [Embedding cache](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/service/EmbeddingCacheWorker.kt): `app/src/main/java/com/newoether/agora/service/EmbeddingCacheWorker.kt`
- [Skills and memory](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/data/SkillManager.kt): `app/src/main/java/com/newoether/agora/data/SkillManager.kt`
- [MCP tools](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/mcp/McpProtocolClient.kt): `app/src/main/java/com/newoether/agora/mcp/McpProtocolClient.kt`
- [Scheduled tasks](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/automation/AutomationScheduler.kt): `app/src/main/java/com/newoether/agora/automation/AutomationScheduler.kt`
- [Remote shell](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/remote/RemoteControl.kt): `app/src/main/java/com/newoether/agora/remote/RemoteControl.kt`
- [Alpine sandbox](https://github.com/searpro/agora/blob/master/app/src/fdroid/java/com/newoether/agora/sandbox/ProotSandboxManager.kt): `app/src/fdroid/java/com/newoether/agora/sandbox/ProotSandboxManager.kt`

### Data and persistence

- [Conversation store](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/data/repository/ConversationRepository.kt): `app/src/main/java/com/newoether/agora/data/repository/ConversationRepository.kt`
- [Chat database](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/data/local/ChatDatabase.kt): `app/src/main/java/com/newoether/agora/data/local/ChatDatabase.kt`
- [Settings](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/data/SettingsManager.kt): `app/src/main/java/com/newoether/agora/data/SettingsManager.kt`

### Device control

- [Phone control](https://github.com/searpro/agora/blob/master/app/src/main/java/com/newoether/agora/phone/PhoneToolProvider.kt): `app/src/main/java/com/newoether/agora/phone/PhoneToolProvider.kt`

### Other components

- **User**
- **Model endpoint**

## Connections

- User → Android app: opens and configures (evidence: `README.md`)
- Android app → Settings: selects provider (evidence: `README.md`)
- User → Agent execution: sends turn (evidence: `README.md`)
- Agent execution → Cloud providers: requests completion (evidence: `README.md`)
- Cloud providers → HTTP transport: uses transport
- HTTP transport → Model endpoint: sends request (evidence: `README.md`)
- Agent execution → Local models: runs local model
- Agent execution → Conversation store: stores response (evidence: `README.md`)
- Conversation store → Chat database: persists locally (evidence: `README.md`)
- Agent execution → Web search: can invoke (evidence: `README.md`)
- Agent execution → Conversation RAG: can retrieve context (evidence: `README.md`)
- Conversation RAG → Embedding cache: indexes vectors (evidence: `README.md`)
- Agent execution → Skills and memory: can use (evidence: `README.md`)
- Agent execution → MCP tools: dispatches tools (evidence: `README.md`)
- Scheduled tasks → Agent execution: runs tasks
- Agent execution → Remote shell: can invoke (evidence: `README.md`)
- Agent execution → Alpine sandbox: can use (evidence: `README.md`)
- Agent execution → Phone control: can control
