# openvoiceos/ovos-core architecture

> Architecture diagram of the GitHub repository openvoiceos/ovos-core, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/openvoiceos/ovos-core
- Repository: https://github.com/openvoiceos/ovos-core

## Overview

##### Main Components

a. Core Services Layer:
- MessageBus Service (mycroft/messagebus/)
- Audio Service (mycroft/audio/)
- Skills Service (mycroft/skills/)
- Intent Services (ovos_core/intent_services/)
- Speech Client (mycroft/client/speech/)
- GUI Service (mycroft/gui/)

b. Input/Output Layer:
- STT (Speech-to-Text) System (mycroft/stt/)
- TTS (Text-to-Speech) System (mycroft/tts/)
- Audio Output System (mycroft/audio/services/)
- GUI Interface (mycroft/gui/interfaces/)

c. Skills Management:
- Skill Manager (mycroft/skills/skill_manager.py)
- Skill Loader (mycroft/skills/skill_loader.py)
- Intent Service (mycroft/skills/intent_service.py)

d. Configuration and System:
- Configuration Management (mycroft/configuration/)
- Session Management (mycroft/session/)
- Identity Management (mycroft/identity/)

##### Relationship Flows

- Voice input flow: Microphone → STT → Intent Services → Skills
- Response flow: Skills → TTS → Audio Output
- Message routing: MessageBus connecting all components
- GUI interactions: Skills ↔ GUI Service ↔ Display

##### Architectural Patterns to Highlight

- Microservice Architecture: Show how components communicate via MessageBus
- Plugin System: Demonstrate how skills and services can be extended
- Multi-language Support: Include language resource handling
- Event-driven Architecture: Show message flow between components

##### Implementation Details

- Component name
- Key files/modules
- Primary responsibilities
- Supported formats/protocols

## Diagram (Mermaid)

```mermaid
%%{init: {'theme': 'base', 'themeVariables': { 'fontSize': '16px'}}}%%
flowchart TB
    subgraph Core["Core Services Layer"]
        MB["MessageBus Service"]:::core
        AS["Audio Service"]:::core
        SS["Skills Service"]:::core
        IS["Intent Services"]:::core
        SC["Speech Client"]:::core
        GS["GUI Service"]:::core
    end

    subgraph IO["Input/Output Layer"]
        STT["STT System"]:::io
        TTS["TTS System"]:::io
        AO["Audio Output System"]:::io
        GUI["GUI Interface"]:::io
    end

    subgraph SM["Skills Management"]
        SKM["Skill Manager"]:::skills
        SKL["Skill Loader"]:::skills
        ISV["Intent Service"]:::skills
    end

    subgraph Config["Configuration and System"]
        CM["Configuration Management"]:::system
        SEM["Session Management"]:::system
        IM["Identity Management"]:::system
    end

    %% Core Service Connections
    MB <--> AS
    MB <--> SS
    MB <--> IS
    MB <--> SC
    MB <--> GS

    %% IO Layer Connections
    STT --> IS
    IS --> SS
    SS --> TTS
    TTS --> AO
    GS <--> GUI

    %% Skills Management Connections
    SS <--> SKM
    SKM <--> SKL
    IS <--> ISV

    %% Configuration Connections
    CM --> MB
    CM --> AS
    CM --> SS
    SEM --> MB
    IM --> MB

    %% Click Events
    click MB "https://github.com/OpenVoiceOS/ovos-core/tree/dev/mycroft/messagebus/"
    click AS "https://github.com/OpenVoiceOS/ovos-core/tree/dev/mycroft/audio/"
    click SS "https://github.com/OpenVoiceOS/ovos-core/tree/dev/mycroft/skills/"
    click IS "https://github.com/OpenVoiceOS/ovos-core/tree/dev/ovos_core/intent_services/"
    click SC "https://github.com/OpenVoiceOS/ovos-core/tree/dev/mycroft/client/speech/"
    click GS "https://github.com/OpenVoiceOS/ovos-core/tree/dev/mycroft/gui/"
    click STT "https://github.com/OpenVoiceOS/ovos-core/tree/dev/mycroft/stt/"
    click TTS "https://github.com/OpenVoiceOS/ovos-core/tree/dev/mycroft/tts/"
    click AO "https://github.com/OpenVoiceOS/ovos-core/tree/dev/mycroft/audio/services/"
    click GUI "https://github.com/OpenVoiceOS/ovos-core/tree/dev/mycroft/gui/interfaces/"
    click SKM "https://github.com/OpenVoiceOS/ovos-core/blob/dev/mycroft/skills/skill_manager.py"
    click SKL "https://github.com/OpenVoiceOS/ovos-core/blob/dev/mycroft/skills/skill_loader.py"
    click ISV "https://github.com/OpenVoiceOS/ovos-core/blob/dev/mycroft/skills/intent_service.py"
    click CM "https://github.com/OpenVoiceOS/ovos-core/tree/dev/mycroft/configuration/"
    click SEM "https://github.com/OpenVoiceOS/ovos-core/tree/dev/mycroft/session/"
    click IM "https://github.com/OpenVoiceOS/ovos-core/tree/dev/mycroft/identity/"

    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef io fill:#2ecc71,stroke:#27ae60,color:white
    classDef skills fill:#e67e22,stroke:#d35400,color:white
    classDef system fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        L1["Core Services"]:::core
        L2["Input/Output Services"]:::io
        L3["Skill Components"]:::skills
        L4["System Services"]:::system
    end
```
