# gabrielpmares/lago-agents architecture

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

- Interactive diagram: https://gitdiagram.com/gabrielpmares/lago-agents
- Repository: https://github.com/gabrielpmares/lago-agents

## Overview

Lago Agents is a control hub for people steering teams of AI coding agents. In the desktop workflow, a person uses the app to review work and issue requests; the API exposes app actions, while Lago’s orchestration and team runtime coordinate agent work and record its state. The hub database, configuration, activity log, and transcripts support status and history. The README also documents live task maps, terminals, file activity, replay, and optional voice and phone access. Backend relationships are grounded in the source index and excerpts; several documented or unsampled capabilities have no asserted internal wiring.

Main entry points: [`lago/api.py`](https://github.com/gabrielpmares/lago-agents/blob/main/lago/api.py) (App API), [`lago/team.py`](https://github.com/gabrielpmares/lago-agents/blob/main/lago/team.py) (Team runtime), [`android/app/src/main/java/com/lagoagents/mobile/net/LagoClient.kt`](https://github.com/gabrielpmares/lago-agents/blob/main/android/app/src/main/java/com/lagoagents/mobile/net/LagoClient.kt) (Paired server client), [`lago/open_tasks.py`](https://github.com/gabrielpmares/lago-agents/blob/main/lago/open_tasks.py) (Open run status)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_desktop["Desktop app<br/>[desktop.py]"]
  node_api["App API<br/>[api.py]"]
end

subgraph group_orchestration["Agent orchestration"]
  node_mcp["Lago assistant tools<br/>[lago_mcp.py]"]
  node_team["Team runtime<br/>[team.py]"]
  node_runner["Agent runner<br/>[runner.py]"]
  node_openruns["Open run status<br/>[open_tasks.py]"]
end

subgraph group_state["Shared state and history"]
  node_config["Configuration<br/>[config_store.py]"]
  node_hub[("Shared work database<br/>[hub.py]")]
  node_activity["Activity and search<br/>[activity.py]"]
  node_transcripts["Run transcripts<br/>[transcripts.py]"]
end

subgraph group_capabilities["Product capabilities"]
  node_accounts["Accounts and usage<br/>[accounts.py]"]
  node_evals["Agent evaluations<br/>[evals.py]"]
  node_terminal["Live terminals"]
  node_liveview["Live map and replay<br/>[app.js]"]
  node_voice["Voice features<br/>[voice.py]"]
  node_connectors["External connectors<br/>[connectors.py]"]
end

subgraph group_mobile["Android companion"]
  node_android["Android app<br/>[MainActivity.kt]"]
  node_mobileclient["Paired server client<br/>[LagoClient.kt]"]
  node_calls["Phone calls<br/>[CallService.kt]"]
  node_alerts["Live alerts"]
  node_updates["App updater<br/>[Updater.kt]"]
end

node_person(("Person"))

node_person -->|"steers work"| node_desktop
node_desktop -->|"invokes actions"| node_api
node_api -->|"dispatches work"| node_team
node_api -->|"invokes tools"| node_mcp
node_team -->|"runs agents"| node_runner
node_team -->|"records work"| node_hub
node_team -->|"loads settings"| node_config
node_runner -->|"loads settings"| node_config
node_openruns -->|"checks running"| node_runner
node_openruns -->|"reads tasks"| node_hub
node_openruns -->|"reads last words"| node_transcripts
node_activity -->|"stores activity"| node_hub
node_api -->|"serves activity"| node_activity
node_api -->|"serves account data"| node_accounts
node_api -->|"serves evaluations"| node_evals
node_person -->|"reviews work"| node_liveview
node_person -->|"watches terminals"| node_terminal
node_person -->|"talks to Lago"| node_voice
node_person -.->|"uses integrations"| node_connectors
node_person -->|"uses phone app"| node_android
node_android -->|"sends requests"| node_mobileclient
node_calls -->|"starts calls"| node_mobileclient
node_alerts -.->|"opens live connection"| node_mobileclient
node_updates -->|"checks and downloads"| node_mobileclient

click node_desktop "https://github.com/gabrielpmares/lago-agents/blob/main/lago/desktop.py"
click node_api "https://github.com/gabrielpmares/lago-agents/blob/main/lago/api.py"
click node_mcp "https://github.com/gabrielpmares/lago-agents/blob/main/lago/lago_mcp.py"
click node_team "https://github.com/gabrielpmares/lago-agents/blob/main/lago/team.py"
click node_runner "https://github.com/gabrielpmares/lago-agents/blob/main/lago/runner.py"
click node_openruns "https://github.com/gabrielpmares/lago-agents/blob/main/lago/open_tasks.py"
click node_config "https://github.com/gabrielpmares/lago-agents/blob/main/lago/config_store.py"
click node_hub "https://github.com/gabrielpmares/lago-agents/blob/main/lago/hub.py"
click node_activity "https://github.com/gabrielpmares/lago-agents/blob/main/lago/activity.py"
click node_transcripts "https://github.com/gabrielpmares/lago-agents/blob/main/lago/transcripts.py"
click node_accounts "https://github.com/gabrielpmares/lago-agents/blob/main/lago/accounts.py"
click node_evals "https://github.com/gabrielpmares/lago-agents/blob/main/lago/evals.py"
click node_liveview "https://github.com/gabrielpmares/lago-agents/blob/main/lago/ui/app.js"
click node_voice "https://github.com/gabrielpmares/lago-agents/blob/main/lago/voice.py"
click node_connectors "https://github.com/gabrielpmares/lago-agents/blob/main/lago/connectors.py"
click node_android "https://github.com/gabrielpmares/lago-agents/blob/main/android/app/src/main/java/com/lagoagents/mobile/MainActivity.kt"
click node_mobileclient "https://github.com/gabrielpmares/lago-agents/blob/main/android/app/src/main/java/com/lagoagents/mobile/net/LagoClient.kt"
click node_calls "https://github.com/gabrielpmares/lago-agents/blob/main/android/app/src/main/java/com/lagoagents/mobile/call/CallService.kt"
click node_alerts "https://github.com/gabrielpmares/lago-agents/blob/main/android/app/src/main/java/com/lagoagents/mobile/alerts/LiveAlertsService.kt"
click node_updates "https://github.com/gabrielpmares/lago-agents/blob/main/android/app/src/main/java/com/lagoagents/mobile/update/Updater.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_desktop,node_api toneBlue
class node_mcp,node_team,node_runner,node_openruns toneAmber
class node_config,node_hub,node_activity,node_transcripts toneMint
class node_accounts,node_evals,node_terminal,node_liveview,node_voice,node_connectors toneRose
class node_android,node_mobileclient,node_calls,node_alerts,node_updates,node_person toneIndigo
```

## Components

### User experience

- [Desktop app](https://github.com/gabrielpmares/lago-agents/blob/main/lago/desktop.py): `lago/desktop.py`
- [App API](https://github.com/gabrielpmares/lago-agents/blob/main/lago/api.py): `lago/api.py`

### Agent orchestration

- [Lago assistant tools](https://github.com/gabrielpmares/lago-agents/blob/main/lago/lago_mcp.py): `lago/lago_mcp.py`
- [Team runtime](https://github.com/gabrielpmares/lago-agents/blob/main/lago/team.py): `lago/team.py`
- [Agent runner](https://github.com/gabrielpmares/lago-agents/blob/main/lago/runner.py): `lago/runner.py`
- [Open run status](https://github.com/gabrielpmares/lago-agents/blob/main/lago/open_tasks.py): `lago/open_tasks.py`

### Shared state and history

- [Configuration](https://github.com/gabrielpmares/lago-agents/blob/main/lago/config_store.py): `lago/config_store.py`
- [Shared work database](https://github.com/gabrielpmares/lago-agents/blob/main/lago/hub.py): `lago/hub.py`
- [Activity and search](https://github.com/gabrielpmares/lago-agents/blob/main/lago/activity.py): `lago/activity.py`
- [Run transcripts](https://github.com/gabrielpmares/lago-agents/blob/main/lago/transcripts.py): `lago/transcripts.py`

### Product capabilities

- [Accounts and usage](https://github.com/gabrielpmares/lago-agents/blob/main/lago/accounts.py): `lago/accounts.py`
- [Agent evaluations](https://github.com/gabrielpmares/lago-agents/blob/main/lago/evals.py): `lago/evals.py`
- **Live terminals**
- [Live map and replay](https://github.com/gabrielpmares/lago-agents/blob/main/lago/ui/app.js): `lago/ui/app.js`
- [Voice features](https://github.com/gabrielpmares/lago-agents/blob/main/lago/voice.py): `lago/voice.py`
- [External connectors](https://github.com/gabrielpmares/lago-agents/blob/main/lago/connectors.py): `lago/connectors.py`

### Android companion

- [Android app](https://github.com/gabrielpmares/lago-agents/blob/main/android/app/src/main/java/com/lagoagents/mobile/MainActivity.kt): `android/app/src/main/java/com/lagoagents/mobile/MainActivity.kt`
- [Paired server client](https://github.com/gabrielpmares/lago-agents/blob/main/android/app/src/main/java/com/lagoagents/mobile/net/LagoClient.kt): `android/app/src/main/java/com/lagoagents/mobile/net/LagoClient.kt`
- [Phone calls](https://github.com/gabrielpmares/lago-agents/blob/main/android/app/src/main/java/com/lagoagents/mobile/call/CallService.kt): `android/app/src/main/java/com/lagoagents/mobile/call/CallService.kt`
- [Live alerts](https://github.com/gabrielpmares/lago-agents/blob/main/android/app/src/main/java/com/lagoagents/mobile/alerts/LiveAlertsService.kt): `android/app/src/main/java/com/lagoagents/mobile/alerts/LiveAlertsService.kt`
- [App updater](https://github.com/gabrielpmares/lago-agents/blob/main/android/app/src/main/java/com/lagoagents/mobile/update/Updater.kt): `android/app/src/main/java/com/lagoagents/mobile/update/Updater.kt`

### Other components

- **Person**

## Connections

- Person → Desktop app: steers work
- Desktop app → App API: invokes actions (evidence: `lago/api.py`)
- App API → Team runtime: dispatches work (evidence: `lago/api.py`)
- App API → Lago assistant tools: invokes tools (evidence: `lago/api.py`)
- Team runtime → Agent runner: runs agents (evidence: `lago/team.py`)
- Team runtime → Shared work database: records work (evidence: `lago/team.py`)
- Team runtime → Configuration: loads settings (evidence: `lago/team.py`)
- Agent runner → Configuration: loads settings (evidence: `lago/runner.py`)
- Open run status → Agent runner: checks running (evidence: `lago/open_tasks.py`)
- Open run status → Shared work database: reads tasks (evidence: `lago/open_tasks.py`)
- Open run status → Run transcripts: reads last words (evidence: `lago/open_tasks.py`)
- Activity and search → Shared work database: stores activity (evidence: `lago/activity.py`)
- App API → Activity and search: serves activity (evidence: `lago/api.py`)
- App API → Accounts and usage: serves account data (evidence: `lago/api.py`)
- App API → Agent evaluations: serves evaluations (evidence: `lago/api.py`)
- Person → Live map and replay: reviews work
- Person → Live terminals: watches terminals
- Person → Voice features: talks to Lago
- Person → External connectors: uses integrations
- Person → Android app: uses phone app
- Android app → Paired server client: sends requests
- Phone calls → Paired server client: starts calls (evidence: `android/app/src/main/java/com/lagoagents/mobile/call/CallService.kt`)
- Live alerts → Paired server client: opens live connection
- App updater → Paired server client: checks and downloads (evidence: `android/app/src/main/java/com/lagoagents/mobile/update/Updater.kt`)
