# ratherrude/elite-dangerous-ai-integration architecture

> Architecture diagram of the GitHub repository ratherrude/elite-dangerous-ai-integration, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ratherrude/elite-dangerous-ai-integration
- Repository: https://github.com/ratherrude/elite-dangerous-ai-integration

## Overview

##### Main Components Identification

a) Core Components:
- Speech Interface (STT/TTS modules)
- AI Language Model Integration
- Game Integration Layer
- Event Management System
- Action Management System
- User Interface (AIGUI)

b) External Services:
- Speech-to-Text Services
- Text-to-Speech Services
- Large Language Model Services
- Game APIs (Elite Dangerous)
- External Data Sources (Galnet, etc.)

**[Commander Voice Input] ←→ [AIGUI Interface]**

**┌─ AI Processing Layer ─────┐**
- [STT Engine] → [LLM Processing] → [TTS Engine] │
- ┘

**┌─ Game Integration Layer ──┐**
- [Event Manager] → [Action Manager] │
- [ED Journal Reader] → [Status Parser] │
- ┘

##### Component Details

a) Input/Output Processing:
- STT Module (src/lib/STT.py)
- TTS Module (src/lib/TTS.py)
- AIGUI (src/AIGUI.py)

b) Core Processing:
- Event Manager (src/lib/EventManager.py)
- Action Manager (src/lib/ActionManager.py)
- Prompt Generator (src/lib/PromptGenerator.py)

c) Game Integration:
- ED Journal (src/lib/EDJournal.py)
- Status Parser (src/lib/StatusParser.py)
- Controller Manager (src/lib/ControllerManager.py)

d) Support Systems:
- Configuration (src/lib/Config.py)
- Database (src/lib/Database.py)
- Logger (src/lib/Logger.py)

##### Notes Section

Notes describing:
- System requirements
- External service dependencies
- Configuration requirements
- Key integration points

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef input fill:#a8d1f0,stroke:#000
    classDef processing fill:#c8e6c9,stroke:#000
    classDef output fill:#ffcdd2,stroke:#000
    classDef eventManager fill:#e1bee7,stroke:#000,stroke-width:2px
    classDef eventFlow stroke:#666,stroke-width:2px,stroke-dasharray: 5 5

    %% Event Manager (Central Component)
    EM[("EventManager")]:::eventManager

    %% Input Layer
    subgraph InputLayer["Input Sources"]
        EDJ["EDJournal"]:::input
        STT["Speech-to-Text"]:::input
        SR["ScreenReader"]:::input
        CM["ControllerManager"]:::input
    end

    %% Processing Layer
    subgraph ProcessingLayer["Processing Components"]
        AM["ActionManager"]:::processing
        PG["PromptGenerator"]:::processing
        SP["StatusParser"]:::processing
        DB[(Database)]:::processing
    end

    %% Output Layer
    subgraph OutputLayer["Output Components"]
        TTS["Text-to-Speech"]:::output
        ACT["Actions"]:::output
        EDK["EDKeys"]:::output
    end

    %% Event Flow Connections
    EDJ --> |"Game Events"| EM
    STT --> |"Voice Commands"| EM
    SR --> |"Screen Data"| EM
    CM --> |"Controller Input"| EM

    EM --> |"Process Events"| AM
    EM --> |"Generate Prompts"| PG
    EM --> |"Parse Status"| SP
    EM <--> |"Store/Retrieve"| DB

    EM --> |"Voice Output"| TTS
    EM --> |"Game Actions"| ACT
    EM --> |"Key Commands"| EDK

    %% Click Events
    click EM "https://github.com/RatherRude/Elite-Dangerous-AI-Integration/blob/main/src/lib/EventManager.py"
    click EDJ "https://github.com/RatherRude/Elite-Dangerous-AI-Integration/blob/main/src/lib/EDJournal.py"
    click STT "https://github.com/RatherRude/Elite-Dangerous-AI-Integration/blob/main/src/lib/STT.py"
    click SR "https://github.com/RatherRude/Elite-Dangerous-AI-Integration/blob/main/src/lib/ScreenReader.py"
    click CM "https://github.com/RatherRude/Elite-Dangerous-AI-Integration/blob/main/src/lib/ControllerManager.py"
    click AM "https://github.com/RatherRude/Elite-Dangerous-AI-Integration/blob/main/src/lib/ActionManager.py"
    click PG "https://github.com/RatherRude/Elite-Dangerous-AI-Integration/blob/main/src/lib/PromptGenerator.py"
    click SP "https://github.com/RatherRude/Elite-Dangerous-AI-Integration/blob/main/src/lib/StatusParser.py"
    click DB "https://github.com/RatherRude/Elite-Dangerous-AI-Integration/blob/main/src/lib/Database.py"
    click TTS "https://github.com/RatherRude/Elite-Dangerous-AI-Integration/blob/main/src/lib/TTS.py"
    click ACT "https://github.com/RatherRude/Elite-Dangerous-AI-Integration/blob/main/src/lib/Actions.py"
    click EDK "https://github.com/RatherRude/Elite-Dangerous-AI-Integration/blob/main/src/lib/EDKeys.py"

    %% Legend
    subgraph Legend
        L1[Input Components]:::input
        L2[Processing Components]:::processing
        L3[Output Components]:::output
        L4[("Event Manager")]:::eventManager
    end
```
