# hamidnawaz583/disaster-chatbot architecture

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

- Interactive diagram: https://gitdiagram.com/hamidnawaz583/disaster-chatbot
- Repository: https://github.com/hamidnawaz583/disaster-chatbot

## Overview

Disaster is a voice-driven desktop assistant: a user speaks after a wake word, the application captures and transcribes a command, the agent reasons through tool calls, and the interface or voice layer presents the outcome. Its tools cover app launching, browser control, desktop input, screen capture/OCR, system information, and terminal commands. The excerpts show the agent’s registry-based execution and several tool registrations; connections among unsampled tool implementations and the registry are therefore shown only where registration is evidenced. The README is empty.

Main entry points: [`core/tool_registry.py`](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/core/tool_registry.py) (Tool registry), [`agent/loop.py`](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/agent/loop.py) (Agent loop), [`voice/voice_agent.py`](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/voice/voice_agent.py) (Voice agent), [`ui/app.py`](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/ui/app.py) (Desktop UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Voice interaction"]
  node_ui["Desktop UI<br/>[app.py]"]
  node_wake["Wake detection<br/>[wakeword.py]"]
  node_listener["Speech listener<br/>[listener.py]"]
  node_speaker["Speech output<br/>[speaker.py]"]
  node_voice_agent["Voice agent<br/>[voice_agent.py]"]
end

subgraph group_agent["Agent reasoning"]
  node_reasoning_loop["Agent loop<br/>[loop.py]"]
  node_brain["Model reasoning<br/>[brain.py]"]
  node_router["Tool router<br/>[router.py]"]
end

subgraph group_tools["Desktop tools"]
  node_apps["App launcher<br/>[launcher.py]"]
  node_browser["Browser control<br/>[browser.py]"]
  node_desktop["Desktop input<br/>[desktop.py]"]
  node_screen["Screen and OCR<br/>[screen.py]"]
  node_system_info["System information<br/>[system.py]"]
  node_command["System command<br/>[command.py]"]
  node_terminal["Safe terminal<br/>[terminal.py]"]
end

subgraph group_infra["Tool infrastructure"]
  node_registry["Tool registry<br/>[tool_registry.py]"]
end

node_user(("User"))

node_user -->|"speaks to"| node_ui
node_ui -->|"detects wake"| node_wake
node_ui -->|"captures speech"| node_listener
node_ui -->|"submits command"| node_reasoning_loop
node_reasoning_loop -.->|"speaks result"| node_speaker
node_voice_agent -->|"detects wake"| node_wake
node_voice_agent -->|"captures speech"| node_listener
node_voice_agent -->|"submits command"| node_reasoning_loop
node_voice_agent -->|"speaks response"| node_speaker
node_reasoning_loop -->|"requests reasoning"| node_brain
node_reasoning_loop -->|"executes tools"| node_registry
node_router -->|"opens app"| node_apps
node_router -->|"opens site"| node_browser
node_router -->|"runs command"| node_command
node_apps -->|"registers tools"| node_registry
node_browser -->|"registers tools"| node_registry
node_desktop -->|"registers tools"| node_registry
node_screen -->|"registers tools"| node_registry
node_system_info -->|"registers tools"| node_registry
node_terminal -->|"registers tools"| node_registry
node_registry -.->|"dispatches tools"| node_desktop
node_registry -.->|"dispatches tools"| node_screen
node_registry -.->|"dispatches tools"| node_system_info
node_registry -.->|"dispatches tools"| node_terminal

click node_ui "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/ui/app.py"
click node_wake "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/voice/wakeword.py"
click node_listener "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/voice/listener.py"
click node_speaker "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/voice/speaker.py"
click node_voice_agent "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/voice/voice_agent.py"
click node_reasoning_loop "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/agent/loop.py"
click node_brain "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/agent/brain.py"
click node_router "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/agent/router.py"
click node_registry "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/core/tool_registry.py"
click node_apps "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/tools/apps/launcher.py"
click node_browser "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/tools/browser/browser.py"
click node_desktop "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/tools/desktop/desktop.py"
click node_screen "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/tools/screen/screen.py"
click node_system_info "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/tools/system.py"
click node_command "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/tools/system/command.py"
click node_terminal "https://github.com/hamidnawaz583/disaster-chatbot/blob/main/tools/terminal/terminal.py"

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_ui,node_wake,node_listener,node_speaker,node_voice_agent,node_user toneBlue
class node_reasoning_loop,node_brain,node_router toneAmber
class node_apps,node_browser,node_desktop,node_screen,node_system_info,node_command,node_terminal toneMint
class node_registry toneRose
```

## Components

### Voice interaction

- [Desktop UI](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/ui/app.py): `ui/app.py`
- [Wake detection](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/voice/wakeword.py): `voice/wakeword.py`
- [Speech listener](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/voice/listener.py): `voice/listener.py`
- [Speech output](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/voice/speaker.py): `voice/speaker.py`
- [Voice agent](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/voice/voice_agent.py): `voice/voice_agent.py`

### Agent reasoning

- [Agent loop](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/agent/loop.py): `agent/loop.py`
- [Model reasoning](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/agent/brain.py): `agent/brain.py`
- [Tool router](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/agent/router.py): `agent/router.py`

### Desktop tools

- [App launcher](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/tools/apps/launcher.py): `tools/apps/launcher.py`
- [Browser control](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/tools/browser/browser.py): `tools/browser/browser.py`
- [Desktop input](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/tools/desktop/desktop.py): `tools/desktop/desktop.py`
- [Screen and OCR](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/tools/screen/screen.py): `tools/screen/screen.py`
- [System information](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/tools/system.py): `tools/system.py`
- [System command](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/tools/system/command.py): `tools/system/command.py`
- [Safe terminal](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/tools/terminal/terminal.py): `tools/terminal/terminal.py`

### Tool infrastructure

- [Tool registry](https://github.com/hamidnawaz583/disaster-chatbot/blob/main/core/tool_registry.py): `core/tool_registry.py`

### Other components

- **User**

## Connections

- User → Desktop UI: speaks to
- Desktop UI → Wake detection: detects wake (evidence: `ui/app.py`)
- Desktop UI → Speech listener: captures speech (evidence: `ui/app.py`)
- Desktop UI → Agent loop: submits command (evidence: `ui/app.py`)
- Agent loop → Speech output: speaks result
- Voice agent → Wake detection: detects wake (evidence: `voice/voice_agent.py`)
- Voice agent → Speech listener: captures speech (evidence: `voice/voice_agent.py`)
- Voice agent → Agent loop: submits command (evidence: `voice/voice_agent.py`)
- Voice agent → Speech output: speaks response (evidence: `voice/voice_agent.py`)
- Agent loop → Model reasoning: requests reasoning (evidence: `agent/loop.py`)
- Agent loop → Tool registry: executes tools (evidence: `agent/loop.py`)
- Tool router → App launcher: opens app (evidence: `agent/router.py`)
- Tool router → Browser control: opens site (evidence: `agent/router.py`)
- Tool router → System command: runs command (evidence: `agent/router.py`)
- App launcher → Tool registry: registers tools (evidence: `tools/apps/launcher.py`)
- Browser control → Tool registry: registers tools (evidence: `tools/browser/browser.py`)
- Desktop input → Tool registry: registers tools (evidence: `tools/desktop/desktop.py`)
- Screen and OCR → Tool registry: registers tools (evidence: `tools/screen/screen.py`)
- System information → Tool registry: registers tools (evidence: `tools/system.py`)
- Safe terminal → Tool registry: registers tools (evidence: `tools/terminal/terminal.py`)
- Tool registry → Desktop input: dispatches tools (evidence: `tools/desktop/desktop.py`)
- Tool registry → Screen and OCR: dispatches tools (evidence: `tools/screen/screen.py`)
- Tool registry → System information: dispatches tools (evidence: `tools/system.py`)
- Tool registry → Safe terminal: dispatches tools (evidence: `tools/terminal/terminal.py`)
