# desosav/core architecture

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

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

## Overview

Home Assistant is a local-first home-automation platform with a modular integration ecosystem. Users configure integrations, which expose device capabilities as entities; the runtime represents state, dispatches events and services, and supports voice-assistant processing through Assist pipelines. Core configuration, registries, authentication, and persistent storage provide supporting layers. The README documents modular integrations and automation, but sampled source does not expose the automation runtime or most integration wiring, so those links are not inferred here.

Main entry points: [`homeassistant/components/assist_pipeline/default_pipeline.py`](https://github.com/desosav/core/blob/dev/homeassistant/components/assist_pipeline/default_pipeline.py) (Default voice pipeline), [`homeassistant/core.py`](https://github.com/desosav/core/blob/dev/homeassistant/core.py) (Home Assistant core), [`homeassistant/helpers/entity.py`](https://github.com/desosav/core/blob/dev/homeassistant/helpers/entity.py) (Entity model), [`homeassistant/loader.py`](https://github.com/desosav/core/blob/dev/homeassistant/loader.py) (Integration loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Core runtime"]
  node_configuration["Integration setup<br/>[config_entries.py]"]
  node_loader["Integration loader<br/>[loader.py]"]
  node_core["Home Assistant core<br/>[core.py]"]
  node_services["Service execution<br/>[service.py]"]
  node_entity["Entity model<br/>[entity.py]"]
  node_events["Event bus<br/>[core.py]"]
  node_device_registry[("Device registry<br/>[device_registry.py]")]
  node_entity_registry[("Entity registry<br/>[entity_registry.py]")]
end

subgraph group_integration["Integrations"]
  node_integrations["Device integrations<br/>[__init__.py]"]
end

subgraph group_identity["Identity and access"]
  node_auth[("Authentication<br/>[auth_store.py]")]
  node_permissions["Permissions<br/>[models.py]"]
end

subgraph group_assist["Voice assistant"]
  node_assist["Assist pipeline<br/>[pipeline.py]"]
  node_assist_default["Default voice pipeline"]
  node_conversation["Conversation<br/>[__init__.py]"]
  node_speech["Speech services<br/>[__init__.py]"]
  node_tts["Speech output<br/>[__init__.py]"]
end

subgraph group_persistence["State and persistence"]
  node_states[("State machine<br/>[core.py]")]
  node_storage[("Persistent storage<br/>[storage.py]")]
  node_backup["Backup and restore<br/>[backup_restore.py]"]
end

node_user(("Home user"))

node_user -.->|"configures"| node_configuration
node_configuration -->|"resolves integration"| node_loader
node_loader -.->|"loads"| node_integrations
node_integrations -.->|"exposes entities"| node_entity
node_core -->|"dispatches events"| node_events
node_core -->|"owns state machine"| node_states
node_services -->|"runs service calls"| node_core
node_services -->|"resolves handlers"| node_loader
node_entity -.->|"registers entities"| node_entity_registry
node_entity -.->|"associates devices"| node_device_registry
node_auth -->|"persists credentials"| node_storage
node_auth -.->|"checks access"| node_permissions
node_assist -->|"runs pipeline"| node_assist_default
node_assist_default -->|"handles conversation"| node_conversation
node_assist_default -->|"uses recognition"| node_speech
node_assist_default -->|"uses synthesis"| node_tts
node_storage -->|"uses runtime"| node_core
node_backup -.->|"backs up data"| node_storage

click node_configuration "https://github.com/desosav/core/blob/dev/homeassistant/config_entries.py"
click node_loader "https://github.com/desosav/core/blob/dev/homeassistant/loader.py"
click node_integrations "https://github.com/desosav/core/blob/dev/homeassistant/components/__init__.py"
click node_core "https://github.com/desosav/core/blob/dev/homeassistant/core.py"
click node_services "https://github.com/desosav/core/blob/dev/homeassistant/helpers/service.py"
click node_entity "https://github.com/desosav/core/blob/dev/homeassistant/helpers/entity.py"
click node_states "https://github.com/desosav/core/blob/dev/homeassistant/core.py"
click node_events "https://github.com/desosav/core/blob/dev/homeassistant/core.py"
click node_device_registry "https://github.com/desosav/core/blob/dev/homeassistant/helpers/device_registry.py"
click node_entity_registry "https://github.com/desosav/core/blob/dev/homeassistant/helpers/entity_registry.py"
click node_auth "https://github.com/desosav/core/blob/dev/homeassistant/auth/auth_store.py"
click node_permissions "https://github.com/desosav/core/blob/dev/homeassistant/auth/permissions/models.py"
click node_assist "https://github.com/desosav/core/blob/dev/homeassistant/components/assist_pipeline/pipeline.py"
click node_assist_default "https://github.com/desosav/core/blob/dev/homeassistant/components/assist_pipeline/default_pipeline.py"
click node_conversation "https://github.com/desosav/core/blob/dev/homeassistant/components/conversation/__init__.py"
click node_speech "https://github.com/desosav/core/blob/dev/homeassistant/components/stt/__init__.py"
click node_tts "https://github.com/desosav/core/blob/dev/homeassistant/components/tts/__init__.py"
click node_storage "https://github.com/desosav/core/blob/dev/homeassistant/helpers/storage.py"
click node_backup "https://github.com/desosav/core/blob/dev/homeassistant/backup_restore.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_configuration,node_loader,node_core,node_services,node_entity,node_events,node_device_registry,node_entity_registry,node_user toneBlue
class node_integrations toneAmber
class node_auth,node_permissions toneMint
class node_assist,node_assist_default,node_conversation,node_speech,node_tts toneRose
class node_states,node_storage,node_backup toneIndigo
```

## Components

### Core runtime

- [Integration setup](https://github.com/desosav/core/blob/dev/homeassistant/config_entries.py): `homeassistant/config_entries.py`
- [Integration loader](https://github.com/desosav/core/blob/dev/homeassistant/loader.py): `homeassistant/loader.py`
- [Home Assistant core](https://github.com/desosav/core/blob/dev/homeassistant/core.py): `homeassistant/core.py`
- [Service execution](https://github.com/desosav/core/blob/dev/homeassistant/helpers/service.py): `homeassistant/helpers/service.py`
- [Entity model](https://github.com/desosav/core/blob/dev/homeassistant/helpers/entity.py): `homeassistant/helpers/entity.py`
- [Event bus](https://github.com/desosav/core/blob/dev/homeassistant/core.py): `homeassistant/core.py`
- [Device registry](https://github.com/desosav/core/blob/dev/homeassistant/helpers/device_registry.py): `homeassistant/helpers/device_registry.py`
- [Entity registry](https://github.com/desosav/core/blob/dev/homeassistant/helpers/entity_registry.py): `homeassistant/helpers/entity_registry.py`

### Integrations

- [Device integrations](https://github.com/desosav/core/blob/dev/homeassistant/components/__init__.py): `homeassistant/components/__init__.py`

### Identity and access

- [Authentication](https://github.com/desosav/core/blob/dev/homeassistant/auth/auth_store.py): `homeassistant/auth/auth_store.py`
- [Permissions](https://github.com/desosav/core/blob/dev/homeassistant/auth/permissions/models.py): `homeassistant/auth/permissions/models.py`

### Voice assistant

- [Assist pipeline](https://github.com/desosav/core/blob/dev/homeassistant/components/assist_pipeline/pipeline.py): `homeassistant/components/assist_pipeline/pipeline.py`
- [Default voice pipeline](https://github.com/desosav/core/blob/dev/homeassistant/components/assist_pipeline/default_pipeline.py): `homeassistant/components/assist_pipeline/default_pipeline.py`
- [Conversation](https://github.com/desosav/core/blob/dev/homeassistant/components/conversation/__init__.py): `homeassistant/components/conversation/__init__.py`
- [Speech services](https://github.com/desosav/core/blob/dev/homeassistant/components/stt/__init__.py): `homeassistant/components/stt/__init__.py`
- [Speech output](https://github.com/desosav/core/blob/dev/homeassistant/components/tts/__init__.py): `homeassistant/components/tts/__init__.py`

### State and persistence

- [State machine](https://github.com/desosav/core/blob/dev/homeassistant/core.py): `homeassistant/core.py`
- [Persistent storage](https://github.com/desosav/core/blob/dev/homeassistant/helpers/storage.py): `homeassistant/helpers/storage.py`
- [Backup and restore](https://github.com/desosav/core/blob/dev/homeassistant/backup_restore.py): `homeassistant/backup_restore.py`

### Other components

- **Home user**

## Connections

- Home user → Integration setup: configures
- Integration setup → Integration loader: resolves integration (evidence: `homeassistant/helpers/service.py`)
- Integration loader → Device integrations: loads
- Device integrations → Entity model: exposes entities
- Home Assistant core → Event bus: dispatches events (evidence: `homeassistant/core.py`)
- Home Assistant core → State machine: owns state machine (evidence: `homeassistant/core.py`)
- Service execution → Home Assistant core: runs service calls (evidence: `homeassistant/helpers/service.py`)
- Service execution → Integration loader: resolves handlers (evidence: `homeassistant/helpers/service.py`)
- Entity model → Entity registry: registers entities (evidence: `homeassistant/helpers/entity_registry.py`)
- Entity model → Device registry: associates devices
- Authentication → Persistent storage: persists credentials (evidence: `homeassistant/auth/auth_store.py`)
- Authentication → Permissions: checks access (evidence: `homeassistant/auth/auth_store.py`)
- Assist pipeline → Default voice pipeline: runs pipeline (evidence: `homeassistant/components/assist_pipeline/pipeline.py`)
- Default voice pipeline → Conversation: handles conversation (evidence: `homeassistant/components/assist_pipeline/default_pipeline.py`)
- Default voice pipeline → Speech services: uses recognition (evidence: `homeassistant/components/assist_pipeline/default_pipeline.py`)
- Default voice pipeline → Speech output: uses synthesis (evidence: `homeassistant/components/assist_pipeline/default_pipeline.py`)
- Persistent storage → Home Assistant core: uses runtime (evidence: `homeassistant/helpers/storage.py`)
- Backup and restore → Persistent storage: backs up data
