# xenometon/ultron-ai architecture

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

- Interactive diagram: https://gitdiagram.com/xenometon/ultron-ai
- Repository: https://github.com/xenometon/ultron-ai

## Overview

Ultron is a small, single-file voice assistant. Its runtime starts with a spoken greeting, repeatedly captures and recognizes speech, then dispatches the recognized text to Wikipedia lookup, website opening, time reporting, or conversational responses; spoken output is produced through text-to-speech. The README also advertises general information and customizable commands, but the shown code has no separate information-search subsystem. All implementation nodes point to Codex.py; the graph reflects only the excerpted source and README.

Main entry points: [`Codex.py`](https://github.com/xenometon/ultron-ai/blob/main/Codex.py) (Command dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("Voice user"))
node_loop["Assistant loop<br/>[Codex.py]"]
node_greeting["Greeting<br/>[Codex.py]"]
node_capture["Voice capture<br/>[Codex.py]"]
node_speech_rec["Speech recognition"]
node_dispatch["Command dispatch<br/>[Codex.py]"]
node_wiki["Wikipedia lookup<br/>[Codex.py]"]
node_time["Time reporting<br/>[Codex.py]"]
node_responses["Assistant responses<br/>[Codex.py]"]
node_tts["Speech output<br/>[Codex.py]"]
node_wikipedia["Wikipedia service"]
node_browser["Web browser"]
node_datetime["System clock"]
node_websites["Requested websites"]

node_user -->|"speaks commands"| node_capture
node_loop -->|"calls"| node_greeting
node_loop -->|"calls"| node_capture
node_capture -->|"recognizes audio"| node_speech_rec
node_capture -->|"returns query"| node_dispatch
node_loop -->|"routes query"| node_dispatch
node_dispatch -->|"calls"| node_wiki
node_dispatch -->|"reports time"| node_time
node_dispatch -->|"handles phrases"| node_responses
node_dispatch -->|"opens pages"| node_browser
node_wiki -->|"requests summary"| node_wikipedia
node_browser -->|"opens URL"| node_websites
node_greeting -->|"reads hour"| node_datetime
node_time -->|"reads current time"| node_datetime
node_greeting -->|"speaks greeting"| node_tts
node_wiki -->|"speaks result"| node_tts
node_time -->|"speaks time"| node_tts
node_responses -->|"speaks reply"| node_tts

click node_loop "https://github.com/xenometon/ultron-ai/blob/main/Codex.py"
click node_greeting "https://github.com/xenometon/ultron-ai/blob/main/Codex.py"
click node_capture "https://github.com/xenometon/ultron-ai/blob/main/Codex.py"
click node_dispatch "https://github.com/xenometon/ultron-ai/blob/main/Codex.py"
click node_wiki "https://github.com/xenometon/ultron-ai/blob/main/Codex.py"
click node_time "https://github.com/xenometon/ultron-ai/blob/main/Codex.py"
click node_responses "https://github.com/xenometon/ultron-ai/blob/main/Codex.py"
click node_tts "https://github.com/xenometon/ultron-ai/blob/main/Codex.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_user,node_browser toneBlue
class node_loop,node_greeting,node_capture,node_dispatch,node_wiki,node_time,node_responses,node_tts toneTeal
class node_speech_rec,node_wikipedia,node_datetime toneIndigo
class node_websites toneMint
```

## Components

### Other components

- **Voice user**
- [Assistant loop](https://github.com/xenometon/ultron-ai/blob/main/Codex.py): `Codex.py`
- [Greeting](https://github.com/xenometon/ultron-ai/blob/main/Codex.py): `Codex.py`
- [Voice capture](https://github.com/xenometon/ultron-ai/blob/main/Codex.py): `Codex.py`
- **Speech recognition**
- [Command dispatch](https://github.com/xenometon/ultron-ai/blob/main/Codex.py): `Codex.py`
- [Wikipedia lookup](https://github.com/xenometon/ultron-ai/blob/main/Codex.py): `Codex.py`
- [Time reporting](https://github.com/xenometon/ultron-ai/blob/main/Codex.py): `Codex.py`
- [Assistant responses](https://github.com/xenometon/ultron-ai/blob/main/Codex.py): `Codex.py`
- [Speech output](https://github.com/xenometon/ultron-ai/blob/main/Codex.py): `Codex.py`
- **Wikipedia service**
- **Web browser**
- **System clock**
- **Requested websites**

## Connections

- Voice user → Voice capture: speaks commands (evidence: `Codex.py`)
- Assistant loop → Greeting: calls (evidence: `Codex.py`)
- Assistant loop → Voice capture: calls (evidence: `Codex.py`)
- Voice capture → Speech recognition: recognizes audio (evidence: `Codex.py`)
- Voice capture → Command dispatch: returns query (evidence: `Codex.py`)
- Assistant loop → Command dispatch: routes query (evidence: `Codex.py`)
- Command dispatch → Wikipedia lookup: calls (evidence: `Codex.py`)
- Command dispatch → Time reporting: reports time (evidence: `Codex.py`)
- Command dispatch → Assistant responses: handles phrases (evidence: `Codex.py`)
- Command dispatch → Web browser: opens pages (evidence: `Codex.py`)
- Wikipedia lookup → Wikipedia service: requests summary (evidence: `Codex.py`)
- Web browser → Requested websites: opens URL
- Greeting → System clock: reads hour (evidence: `Codex.py`)
- Time reporting → System clock: reads current time (evidence: `Codex.py`)
- Greeting → Speech output: speaks greeting (evidence: `Codex.py`)
- Wikipedia lookup → Speech output: speaks result (evidence: `Codex.py`)
- Time reporting → Speech output: speaks time (evidence: `Codex.py`)
- Assistant responses → Speech output: speaks reply (evidence: `Codex.py`)
