# joaovitoramaral27/moth architecture

> Architecture diagram of the GitHub repository joaovitoramaral27/moth, 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/joaovitoramaral27/moth
- Repository: https://github.com/joaovitoramaral27/moth

## Overview

The tree suggests Moth is a desktop conversational assistant, with interface, orchestration, model inference, memory, actions, and voice components. It also includes tokenizer and model-training code, so those are shown as a separate development capability. The README is empty and the provided source excerpts contain no implementation text; relationships and runtime entry points therefore cannot be verified. The graph shows the named components without inferring call flows.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Assistant app"]
  node_main["Application entry<br/>[main.py]"]
  node_window["Desktop window<br/>[window.py]"]
  node_chat["Chat interface<br/>[chat.py]"]
  node_settings["Settings interface<br/>[settings.py]"]
  node_moth_core["Assistant core<br/>[moth_core.py]"]
  node_orchestrator["Orchestrator<br/>[orchestrator.py]"]
  node_context["Conversation context<br/>[context.py]"]
  node_personality["Personality<br/>[personality.py]"]
end

subgraph group_brain["Model runtime"]
  node_inference["Inference engine<br/>[engine.py]"]
  node_transformer["Transformer model<br/>[transformer.py]"]
  node_attention["Attention<br/>[attention.py]"]
  node_layers["Model layers<br/>[layers.py]"]
  node_embeddings["Embeddings<br/>[embeddings.py]"]
  node_tokenizer["Tokenizer<br/>[tokenizer.py]"]
end

subgraph group_memory["Memory"]
  node_memory_db[("Memory database<br/>[database.py]")]
  node_long_term["Long-term memory<br/>[long_term.py]"]
  node_short_term["Short-term memory<br/>[short_term.py]"]
  node_mothdb[("Moth database<br/>[mothdb.db]")]
end

subgraph group_capabilities["Assistant capabilities"]
  node_apps["App actions<br/>[apps.py]"]
  node_files["File actions<br/>[files.py]"]
  node_reminders["Reminders<br/>[reminders.py]"]
  node_call_word["Wake phrase<br/>[call_word.py]"]
  node_hearing["Speech input<br/>[hearing.py]"]
  node_voice["Voice output<br/>[voice.py]"]
end

subgraph group_learning["Model development"]
  node_dataset["Training dataset<br/>[dataset.py]"]
  node_trainer["Model trainer<br/>[trainer.py]"]
  node_evaluation["Model evaluation<br/>[evaluation.py]"]
  node_tokenizer_training["Tokenizer training<br/>[train_tokenizer.py]"]
end

click node_main "https://github.com/joaovitoramaral27/moth/blob/master/main.py"
click node_window "https://github.com/joaovitoramaral27/moth/blob/master/interface/window.py"
click node_chat "https://github.com/joaovitoramaral27/moth/blob/master/interface/chat.py"
click node_settings "https://github.com/joaovitoramaral27/moth/blob/master/interface/settings.py"
click node_moth_core "https://github.com/joaovitoramaral27/moth/blob/master/core/moth_core.py"
click node_orchestrator "https://github.com/joaovitoramaral27/moth/blob/master/core/orchestrator.py"
click node_context "https://github.com/joaovitoramaral27/moth/blob/master/core/context.py"
click node_personality "https://github.com/joaovitoramaral27/moth/blob/master/core/personality.py"
click node_inference "https://github.com/joaovitoramaral27/moth/blob/master/brain/inference/engine.py"
click node_transformer "https://github.com/joaovitoramaral27/moth/blob/master/brain/model/transformer.py"
click node_attention "https://github.com/joaovitoramaral27/moth/blob/master/brain/model/attention.py"
click node_layers "https://github.com/joaovitoramaral27/moth/blob/master/brain/model/layers.py"
click node_embeddings "https://github.com/joaovitoramaral27/moth/blob/master/brain/model/embeddings.py"
click node_tokenizer "https://github.com/joaovitoramaral27/moth/blob/master/brain/tokenizer/tokenizer.py"
click node_memory_db "https://github.com/joaovitoramaral27/moth/blob/master/memory/database.py"
click node_long_term "https://github.com/joaovitoramaral27/moth/blob/master/memory/long_term.py"
click node_short_term "https://github.com/joaovitoramaral27/moth/blob/master/memory/short_term.py"
click node_mothdb "https://github.com/joaovitoramaral27/moth/blob/master/storage/mothdb.db"
click node_apps "https://github.com/joaovitoramaral27/moth/blob/master/actions/apps.py"
click node_files "https://github.com/joaovitoramaral27/moth/blob/master/actions/files.py"
click node_reminders "https://github.com/joaovitoramaral27/moth/blob/master/actions/reminders.py"
click node_call_word "https://github.com/joaovitoramaral27/moth/blob/master/voice/call_word.py"
click node_hearing "https://github.com/joaovitoramaral27/moth/blob/master/voice/hearing.py"
click node_voice "https://github.com/joaovitoramaral27/moth/blob/master/voice/voice.py"
click node_dataset "https://github.com/joaovitoramaral27/moth/blob/master/brain/training/dataset.py"
click node_trainer "https://github.com/joaovitoramaral27/moth/blob/master/brain/training/trainer.py"
click node_evaluation "https://github.com/joaovitoramaral27/moth/blob/master/brain/training/evaluation.py"
click node_tokenizer_training "https://github.com/joaovitoramaral27/moth/blob/master/brain/tokenizer/train_tokenizer.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_main,node_window,node_chat,node_settings,node_moth_core,node_orchestrator,node_context,node_personality toneBlue
class node_inference,node_transformer,node_attention,node_layers,node_embeddings,node_tokenizer toneAmber
class node_memory_db,node_long_term,node_short_term,node_mothdb toneMint
class node_apps,node_files,node_reminders,node_call_word,node_hearing,node_voice toneRose
class node_dataset,node_trainer,node_evaluation,node_tokenizer_training toneIndigo
```

## Components

### Assistant app

- [Application entry](https://github.com/joaovitoramaral27/moth/blob/master/main.py): `main.py`
- [Desktop window](https://github.com/joaovitoramaral27/moth/blob/master/interface/window.py): `interface/window.py`
- [Chat interface](https://github.com/joaovitoramaral27/moth/blob/master/interface/chat.py): `interface/chat.py`
- [Settings interface](https://github.com/joaovitoramaral27/moth/blob/master/interface/settings.py): `interface/settings.py`
- [Assistant core](https://github.com/joaovitoramaral27/moth/blob/master/core/moth_core.py): `core/moth_core.py`
- [Orchestrator](https://github.com/joaovitoramaral27/moth/blob/master/core/orchestrator.py): `core/orchestrator.py`
- [Conversation context](https://github.com/joaovitoramaral27/moth/blob/master/core/context.py): `core/context.py`
- [Personality](https://github.com/joaovitoramaral27/moth/blob/master/core/personality.py): `core/personality.py`

### Model runtime

- [Inference engine](https://github.com/joaovitoramaral27/moth/blob/master/brain/inference/engine.py): `brain/inference/engine.py`
- [Transformer model](https://github.com/joaovitoramaral27/moth/blob/master/brain/model/transformer.py): `brain/model/transformer.py`
- [Attention](https://github.com/joaovitoramaral27/moth/blob/master/brain/model/attention.py): `brain/model/attention.py`
- [Model layers](https://github.com/joaovitoramaral27/moth/blob/master/brain/model/layers.py): `brain/model/layers.py`
- [Embeddings](https://github.com/joaovitoramaral27/moth/blob/master/brain/model/embeddings.py): `brain/model/embeddings.py`
- [Tokenizer](https://github.com/joaovitoramaral27/moth/blob/master/brain/tokenizer/tokenizer.py): `brain/tokenizer/tokenizer.py`

### Memory

- [Memory database](https://github.com/joaovitoramaral27/moth/blob/master/memory/database.py): `memory/database.py`
- [Long-term memory](https://github.com/joaovitoramaral27/moth/blob/master/memory/long_term.py): `memory/long_term.py`
- [Short-term memory](https://github.com/joaovitoramaral27/moth/blob/master/memory/short_term.py): `memory/short_term.py`
- [Moth database](https://github.com/joaovitoramaral27/moth/blob/master/storage/mothdb.db): `storage/mothdb.db`

### Assistant capabilities

- [App actions](https://github.com/joaovitoramaral27/moth/blob/master/actions/apps.py): `actions/apps.py`
- [File actions](https://github.com/joaovitoramaral27/moth/blob/master/actions/files.py): `actions/files.py`
- [Reminders](https://github.com/joaovitoramaral27/moth/blob/master/actions/reminders.py): `actions/reminders.py`
- [Wake phrase](https://github.com/joaovitoramaral27/moth/blob/master/voice/call_word.py): `voice/call_word.py`
- [Speech input](https://github.com/joaovitoramaral27/moth/blob/master/voice/hearing.py): `voice/hearing.py`
- [Voice output](https://github.com/joaovitoramaral27/moth/blob/master/voice/voice.py): `voice/voice.py`

### Model development

- [Training dataset](https://github.com/joaovitoramaral27/moth/blob/master/brain/training/dataset.py): `brain/training/dataset.py`
- [Model trainer](https://github.com/joaovitoramaral27/moth/blob/master/brain/training/trainer.py): `brain/training/trainer.py`
- [Model evaluation](https://github.com/joaovitoramaral27/moth/blob/master/brain/training/evaluation.py): `brain/training/evaluation.py`
- [Tokenizer training](https://github.com/joaovitoramaral27/moth/blob/master/brain/tokenizer/train_tokenizer.py): `brain/tokenizer/train_tokenizer.py`
