# titechprabhasolutions/brahma-echo architecture

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

- Interactive diagram: https://gitdiagram.com/titechprabhasolutions/brahma-echo
- Repository: https://github.com/titechprabhasolutions/brahma-echo

## Overview

Brahma Echo is a Windows desktop AI assistant whose main workflow is accepting voice or text requests, interpreting them with AI, and carrying out desktop or productivity actions. Its wider product includes screen context, learning and self-healing, smart-home controls, and remote Android access. The graph preserves those documented branches; some subsystem links rely on README descriptions or source-index references rather than sampled call sites, so those relationships are dashed where their exact runtime wiring is unverified.

Main entry points: [`main.py`](https://github.com/titechprabhasolutions/brahma-echo/blob/main/main.py) (Assistant Entry), [`agent/executor.py`](https://github.com/titechprabhasolutions/brahma-echo/blob/main/agent/executor.py) (Action Executor), [`llm_client.py`](https://github.com/titechprabhasolutions/brahma-echo/blob/main/llm_client.py) (AI Client), [`brahma_connect/service.py`](https://github.com/titechprabhasolutions/brahma-echo/blob/main/brahma_connect/service.py) (Connect Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_assistant["Assistant Runtime"]
  node_main["Assistant Entry<br/>[main.py]"]
  node_ui["Desktop UI<br/>[ui.py]"]
  node_dashboard["Local Dashboard<br/>[server.py]"]
  node_planner["Task Planner<br/>[planner.py]"]
  node_executor["Action Executor<br/>[executor.py]"]
end

subgraph group_intelligence["AI and Learning"]
  node_llm["AI Client<br/>[llm_client.py]"]
  node_openrouter["OpenRouter Client<br/>[or_client.py]"]
  node_memory[("Long-term Memory<br/>[memory_manager.py]")]
  node_learned[("Learned Rules<br/>[learned_rules.py]")]
  node_healing["Self-healing"]
end

subgraph group_actions["Desktop Actions"]
  node_screen["Screen Context"]
  node_files["File Operations<br/>[file_controller.py]"]
  node_filecontent["File Inspection<br/>[file_processor.py]"]
  node_browser["Browser Automation<br/>[browser_control.py]"]
  node_workspace["Google Workspace"]
  node_diagnostics["System Diagnostics"]
  node_smart_home["Smart Home<br/>[service.py]"]
end

subgraph group_connect["Remote Connect"]
  node_connect_action["Connect Controls<br/>[brahma_connect.py]"]
  node_connect_service["Connect Service<br/>[service.py]"]
  node_gateway["Connect Gateway<br/>[server.py]"]
  node_router["Command Router<br/>[command_router.py]"]
  node_devices[("Device Registry<br/>[device_manager.py]")]
  node_android["Android Companion"]
  node_android_ws["Android WebSocket"]
end

subgraph group_extensions["Integrations"]
  node_ai_provider(("AI Provider"))
  node_playwright["Playwright MCP"]
end

node_user(("User"))

node_user -->|"requests tasks"| node_main
node_main -.->|"presents assistant"| node_ui
node_main -.->|"plans tasks"| node_planner
node_planner -.->|"dispatches actions"| node_executor
node_main -.->|"requests AI"| node_llm
node_llm -->|"uses fallback"| node_openrouter
node_llm -.->|"sends prompts"| node_ai_provider
node_main -.->|"uses memory"| node_memory
node_main -->|"loads learned rules"| node_learned
node_main -.->|"offers self-repair"| node_healing
node_main -->|"inspects screen"| node_screen
node_executor -.->|"dispatches file actions"| node_files
node_executor -.->|"dispatches inspection"| node_filecontent
node_executor -->|"dispatches browser actions"| node_browser
node_executor -->|"dispatches workspace actions"| node_workspace
node_executor -->|"dispatches diagnostics"| node_diagnostics
node_executor -.->|"dispatches controls"| node_smart_home
node_browser -->|"uses MCP"| node_playwright
node_connect_action -->|"calls service"| node_connect_service
node_connect_service -->|"starts gateway"| node_gateway
node_gateway -.->|"routes commands"| node_router
node_gateway -.->|"manages devices"| node_devices
node_router -->|"resolves devices"| node_devices
node_android_ws -->|"dispatches commands"| node_android
node_dashboard -.->|"submits commands"| node_main
node_user -->|"uses remote dashboard"| node_dashboard
node_connect_service -.->|"communicates remotely"| node_android_ws

click node_main "https://github.com/titechprabhasolutions/brahma-echo/blob/main/main.py"
click node_ui "https://github.com/titechprabhasolutions/brahma-echo/blob/main/ui.py"
click node_dashboard "https://github.com/titechprabhasolutions/brahma-echo/blob/main/dashboard/server.py"
click node_planner "https://github.com/titechprabhasolutions/brahma-echo/blob/main/agent/planner.py"
click node_executor "https://github.com/titechprabhasolutions/brahma-echo/blob/main/agent/executor.py"
click node_llm "https://github.com/titechprabhasolutions/brahma-echo/blob/main/llm_client.py"
click node_openrouter "https://github.com/titechprabhasolutions/brahma-echo/blob/main/or_client.py"
click node_memory "https://github.com/titechprabhasolutions/brahma-echo/blob/main/memory/memory_manager.py"
click node_learned "https://github.com/titechprabhasolutions/brahma-echo/blob/main/core/learned_rules.py"
click node_healing "https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/auto_heal_engine.py"
click node_screen "https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/screen_processor.py"
click node_files "https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/file_controller.py"
click node_filecontent "https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/file_processor.py"
click node_browser "https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/browser_control.py"
click node_workspace "https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/google_workspace_mcp.py"
click node_diagnostics "https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/system_diagnostics_mcp.py"
click node_smart_home "https://github.com/titechprabhasolutions/brahma-echo/blob/main/smart_home/service.py"
click node_connect_action "https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/brahma_connect.py"
click node_connect_service "https://github.com/titechprabhasolutions/brahma-echo/blob/main/brahma_connect/service.py"
click node_gateway "https://github.com/titechprabhasolutions/brahma-echo/blob/main/brahma_connect/gateway/server.py"
click node_router "https://github.com/titechprabhasolutions/brahma-echo/blob/main/brahma_connect/gateway/command_router.py"
click node_devices "https://github.com/titechprabhasolutions/brahma-echo/blob/main/brahma_connect/gateway/device_manager.py"
click node_android "https://github.com/titechprabhasolutions/brahma-echo/blob/main/brahma-connect-android/app/src/main/java/com/brahma/connect/commands/DeviceCommandHandler.kt"
click node_android_ws "https://github.com/titechprabhasolutions/brahma-echo/blob/main/brahma-connect-android/app/src/main/java/com/brahma/connect/network/BrahmaWebSocketClient.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_main,node_ui,node_dashboard,node_planner,node_executor,node_user toneBlue
class node_llm,node_openrouter,node_memory,node_learned,node_healing toneAmber
class node_screen,node_files,node_filecontent,node_browser,node_workspace,node_diagnostics,node_smart_home toneMint
class node_connect_action,node_connect_service,node_gateway,node_router,node_devices,node_android,node_android_ws toneRose
class node_ai_provider,node_playwright toneIndigo
```

## Components

### Assistant Runtime

- [Assistant Entry](https://github.com/titechprabhasolutions/brahma-echo/blob/main/main.py): `main.py`
- [Desktop UI](https://github.com/titechprabhasolutions/brahma-echo/blob/main/ui.py): `ui.py`
- [Local Dashboard](https://github.com/titechprabhasolutions/brahma-echo/blob/main/dashboard/server.py): `dashboard/server.py`
- [Task Planner](https://github.com/titechprabhasolutions/brahma-echo/blob/main/agent/planner.py): `agent/planner.py`
- [Action Executor](https://github.com/titechprabhasolutions/brahma-echo/blob/main/agent/executor.py): `agent/executor.py`

### AI and Learning

- [AI Client](https://github.com/titechprabhasolutions/brahma-echo/blob/main/llm_client.py): `llm_client.py`
- [OpenRouter Client](https://github.com/titechprabhasolutions/brahma-echo/blob/main/or_client.py): `or_client.py`
- [Long-term Memory](https://github.com/titechprabhasolutions/brahma-echo/blob/main/memory/memory_manager.py): `memory/memory_manager.py`
- [Learned Rules](https://github.com/titechprabhasolutions/brahma-echo/blob/main/core/learned_rules.py): `core/learned_rules.py`
- [Self-healing](https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/auto_heal_engine.py): `actions/auto_heal_engine.py`

### Desktop Actions

- [Screen Context](https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/screen_processor.py): `actions/screen_processor.py`
- [File Operations](https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/file_controller.py): `actions/file_controller.py`
- [File Inspection](https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/file_processor.py): `actions/file_processor.py`
- [Browser Automation](https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/browser_control.py): `actions/browser_control.py`
- [Google Workspace](https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/google_workspace_mcp.py): `actions/google_workspace_mcp.py`
- [System Diagnostics](https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/system_diagnostics_mcp.py): `actions/system_diagnostics_mcp.py`
- [Smart Home](https://github.com/titechprabhasolutions/brahma-echo/blob/main/smart_home/service.py): `smart_home/service.py`

### Remote Connect

- [Connect Controls](https://github.com/titechprabhasolutions/brahma-echo/blob/main/actions/brahma_connect.py): `actions/brahma_connect.py`
- [Connect Service](https://github.com/titechprabhasolutions/brahma-echo/blob/main/brahma_connect/service.py): `brahma_connect/service.py`
- [Connect Gateway](https://github.com/titechprabhasolutions/brahma-echo/blob/main/brahma_connect/gateway/server.py): `brahma_connect/gateway/server.py`
- [Command Router](https://github.com/titechprabhasolutions/brahma-echo/blob/main/brahma_connect/gateway/command_router.py): `brahma_connect/gateway/command_router.py`
- [Device Registry](https://github.com/titechprabhasolutions/brahma-echo/blob/main/brahma_connect/gateway/device_manager.py): `brahma_connect/gateway/device_manager.py`
- [Android Companion](https://github.com/titechprabhasolutions/brahma-echo/blob/main/brahma-connect-android/app/src/main/java/com/brahma/connect/commands/DeviceCommandHandler.kt): `brahma-connect-android/app/src/main/java/com/brahma/connect/commands/DeviceCommandHandler.kt`
- [Android WebSocket](https://github.com/titechprabhasolutions/brahma-echo/blob/main/brahma-connect-android/app/src/main/java/com/brahma/connect/network/BrahmaWebSocketClient.kt): `brahma-connect-android/app/src/main/java/com/brahma/connect/network/BrahmaWebSocketClient.kt`

### Integrations

- **AI Provider**
- **Playwright MCP**

### Other components

- **User**

## Connections

- User → Assistant Entry: requests tasks
- Assistant Entry → Desktop UI: presents assistant (evidence: `main.py`)
- Assistant Entry → Task Planner: plans tasks
- Task Planner → Action Executor: dispatches actions
- Assistant Entry → AI Client: requests AI (evidence: `main.py`)
- AI Client → OpenRouter Client: uses fallback (evidence: `llm_client.py`)
- AI Client → AI Provider: sends prompts
- Assistant Entry → Long-term Memory: uses memory (evidence: `main.py`)
- Assistant Entry → Learned Rules: loads learned rules (evidence: `main.py`)
- Assistant Entry → Self-healing: offers self-repair
- Assistant Entry → Screen Context: inspects screen (evidence: `main.py`)
- Action Executor → File Operations: dispatches file actions
- Action Executor → File Inspection: dispatches inspection
- Action Executor → Browser Automation: dispatches browser actions
- Action Executor → Google Workspace: dispatches workspace actions
- Action Executor → System Diagnostics: dispatches diagnostics
- Action Executor → Smart Home: dispatches controls
- Browser Automation → Playwright MCP: uses MCP
- Connect Controls → Connect Service: calls service (evidence: `actions/brahma_connect.py`)
- Connect Service → Connect Gateway: starts gateway (evidence: `brahma_connect/service.py`)
- Connect Gateway → Command Router: routes commands (evidence: `brahma_connect/gateway/server.py`)
- Connect Gateway → Device Registry: manages devices (evidence: `brahma_connect/gateway/server.py`)
- Command Router → Device Registry: resolves devices (evidence: `brahma_connect/gateway/command_router.py`)
- Android WebSocket → Android Companion: dispatches commands (evidence: `brahma-connect-android/app/src/main/java/com/brahma/connect/network/BrahmaWebSocketClient.kt`)
- Local Dashboard → Assistant Entry: submits commands (evidence: `main.py`)
- User → Local Dashboard: uses remote dashboard
- Connect Service → Android WebSocket: communicates remotely
