# absolutejekaii/akira architecture

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

- Interactive diagram: https://gitdiagram.com/absolutejekaii/akira
- Repository: https://github.com/absolutejekaii/akira

## Overview

AKIRA is a voice-first Indonesian calendar and reminder assistant, with a desktop interface and a terminal mode. Its main workflow runs from wake-word or manual activation through recording, parallel speech recognition, language understanding, dialog and confirmation, calendar execution, and spoken response. Separate branches support alarms, reminders, ambient listening, and desktop controls. Relationships are based on the README and SOURCE INDEX references; where implementation details were not excerpted, documented workflow links are cited to the README rather than treated as inspected source.

Main entry points: [`src/app.py`](https://github.com/absolutejekaii/akira/blob/main/src/app.py) (Assistant orchestrator), [`src/nlp/parser.py`](https://github.com/absolutejekaii/akira/blob/main/src/nlp/parser.py) (NLP facade), [`src/wakeword/detector.py`](https://github.com/absolutejekaii/akira/blob/main/src/wakeword/detector.py) (Wake-word detector), [`akira_app.py`](https://github.com/absolutejekaii/akira/blob/main/akira_app.py) (Desktop interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop controls"]
  node_desktop_app["Desktop interface<br/>[akira_app.py]"]
  node_gui_runner["GUI runner<br/>[runner.py]"]
  node_hotkeys["Keyboard shortcuts<br/>[hotkeys.py]"]
  node_trigger["Input trigger queue<br/>[trigger.py]"]
end

subgraph group_voice["Voice pipeline"]
  node_wakeword["Wake-word detector<br/>[detector.py]"]
  node_ambient["Ambient listener"]
  node_recorder["Audio recorder<br/>[recorder.py]"]
  node_transcriber["STT orchestrator<br/>[transcriber.py]"]
  node_stt_ensemble["STT ensemble<br/>[ensemble.py]"]
  node_stt_backends["STT backends<br/>[backends.py]"]
  node_tts["Speech output<br/>[speaker.py]"]
end

subgraph group_language["Language understanding"]
  node_nlp_normalizer["Text normalizer<br/>[text_normalizer.py]"]
  node_nlp_intent["Intent classifier"]
  node_nlp_dates["Date-time parser"]
  node_nlp_entities["Entity extractor<br/>[slm_extractor.py]"]
  node_nlp_parser["NLP facade<br/>[parser.py]"]
  node_nlp_reasoner["LLM reasoner<br/>[groq_reasoner.py]"]
  node_nlp_correction["Correction parser<br/>[correction.py]"]
end

subgraph group_dialog_calendar["Dialog and calendar"]
  node_app["Assistant orchestrator<br/>[app.py]"]
  node_dialog_state["Dialog state machine<br/>[state_machine.py]"]
  node_dialog_context["Session context<br/>[context.py]"]
  node_dialog_confirmation["Confirmation flow<br/>[confirmation.py]"]
  node_calendar_executor["Calendar executor<br/>[executor.py]"]
  node_calendar_crud["Calendar operations<br/>[crud.py]"]
  node_calendar_auth["Calendar authentication<br/>[auth.py]"]
  node_alarm["Alarm and timer<br/>[alarm.py]"]
  node_reminder["Calendar reminders<br/>[reminder.py]"]
  node_self_destruct["Reminder lifecycle<br/>[self_destruct.py]"]
end

subgraph group_support["Session services"]
  node_settings["User settings<br/>[user_settings.py]"]
  node_session["Session state<br/>[session_state.py]"]
  node_greeting["Greeting<br/>[greeting.py]"]
end

node_user(("User"))
node_microphone(("Microphone"))
node_google_calendar[("Google Calendar API")]

node_user -->|"speaks into"| node_microphone
node_microphone -->|"audio input"| node_wakeword
node_wakeword -->|"activates"| node_recorder
node_wakeword -->|"enables listening"| node_ambient
node_ambient -->|"uses detector"| node_wakeword
node_recorder -->|"recorded audio"| node_transcriber
node_transcriber -->|"transcribes with"| node_stt_ensemble
node_stt_ensemble -->|"runs engines"| node_stt_backends
node_stt_backends -.->|"audio transcription request"| node_user
node_app -->|"monitors activation"| node_wakeword
node_app -->|"records speech"| node_recorder
node_app -->|"requests transcription"| node_transcriber
node_app -->|"parses command"| node_nlp_parser
node_nlp_parser -->|"normalizes text"| node_nlp_normalizer
node_nlp_parser -->|"classifies intent"| node_nlp_intent
node_nlp_parser -->|"parses dates"| node_nlp_dates
node_nlp_parser -->|"extracts entities"| node_nlp_entities
node_nlp_parser -->|"uses context"| node_dialog_context
node_nlp_intent -->|"reasons when needed"| node_nlp_reasoner
node_nlp_intent -->|"uses extraction"| node_nlp_entities
node_app -->|"reconciles speech"| node_nlp_reasoner
node_app -->|"runs dialog"| node_dialog_state
node_dialog_state -->|"parses replies"| node_nlp_parser
node_dialog_state -->|"interprets replies"| node_nlp_reasoner
node_app -->|"requests confirmation"| node_dialog_confirmation
node_dialog_confirmation -->|"parses corrections"| node_nlp_correction
node_nlp_correction -->|"parses corrected dates"| node_nlp_dates
node_app -->|"executes confirmed action"| node_calendar_executor
node_calendar_executor -->|"dispatches operations"| node_calendar_crud
node_calendar_crud -->|"obtains credentials"| node_calendar_auth
node_calendar_crud -->|"reads and writes"| node_google_calendar
node_app -->|"handles alarm requests"| node_alarm
node_app -->|"handles reminders"| node_reminder
node_reminder -->|"stores reminders"| node_calendar_crud
node_reminder -->|"uses calendar actions"| node_calendar_executor
node_app -.->|"manages reminder lifecycle"| node_self_destruct
node_app -->|"speaks responses"| node_tts
node_user -->|"uses desktop controls"| node_desktop_app
node_desktop_app -->|"starts assistant"| node_gui_runner
node_gui_runner -->|"runs assistant"| node_app
node_desktop_app -->|"configures shortcuts"| node_hotkeys
node_hotkeys -->|"queues activation"| node_trigger
node_desktop_app -->|"queues typed commands"| node_trigger
node_app -->|"checks queued inputs"| node_trigger
node_app -->|"loads preferences"| node_settings
node_app -.->|"tracks session"| node_session
node_app -.->|"greets user"| node_greeting

click node_wakeword "https://github.com/absolutejekaii/akira/blob/main/src/wakeword/detector.py"
click node_ambient "https://github.com/absolutejekaii/akira/blob/main/src/audio/ambient_listener.py"
click node_recorder "https://github.com/absolutejekaii/akira/blob/main/src/audio/recorder.py"
click node_transcriber "https://github.com/absolutejekaii/akira/blob/main/src/stt/transcriber.py"
click node_stt_ensemble "https://github.com/absolutejekaii/akira/blob/main/src/stt/ensemble.py"
click node_stt_backends "https://github.com/absolutejekaii/akira/blob/main/src/stt/backends.py"
click node_nlp_normalizer "https://github.com/absolutejekaii/akira/blob/main/src/nlp/text_normalizer.py"
click node_nlp_intent "https://github.com/absolutejekaii/akira/blob/main/src/nlp/intent_classifier.py"
click node_nlp_dates "https://github.com/absolutejekaii/akira/blob/main/src/nlp/date_time_parser.py"
click node_nlp_entities "https://github.com/absolutejekaii/akira/blob/main/src/nlp/slm_extractor.py"
click node_nlp_parser "https://github.com/absolutejekaii/akira/blob/main/src/nlp/parser.py"
click node_nlp_reasoner "https://github.com/absolutejekaii/akira/blob/main/src/nlp/groq_reasoner.py"
click node_nlp_correction "https://github.com/absolutejekaii/akira/blob/main/src/nlp/correction.py"
click node_app "https://github.com/absolutejekaii/akira/blob/main/src/app.py"
click node_dialog_state "https://github.com/absolutejekaii/akira/blob/main/src/dialog/state_machine.py"
click node_dialog_context "https://github.com/absolutejekaii/akira/blob/main/src/dialog/context.py"
click node_dialog_confirmation "https://github.com/absolutejekaii/akira/blob/main/src/dialog/confirmation.py"
click node_calendar_executor "https://github.com/absolutejekaii/akira/blob/main/src/calendar_service/executor.py"
click node_calendar_crud "https://github.com/absolutejekaii/akira/blob/main/src/calendar_service/crud.py"
click node_calendar_auth "https://github.com/absolutejekaii/akira/blob/main/src/calendar_service/auth.py"
click node_alarm "https://github.com/absolutejekaii/akira/blob/main/src/dialog/alarm.py"
click node_reminder "https://github.com/absolutejekaii/akira/blob/main/src/dialog/reminder.py"
click node_self_destruct "https://github.com/absolutejekaii/akira/blob/main/src/dialog/self_destruct.py"
click node_desktop_app "https://github.com/absolutejekaii/akira/blob/main/akira_app.py"
click node_gui_runner "https://github.com/absolutejekaii/akira/blob/main/src/gui/runner.py"
click node_hotkeys "https://github.com/absolutejekaii/akira/blob/main/src/gui/hotkeys.py"
click node_trigger "https://github.com/absolutejekaii/akira/blob/main/src/utils/trigger.py"
click node_tts "https://github.com/absolutejekaii/akira/blob/main/src/tts/speaker.py"
click node_settings "https://github.com/absolutejekaii/akira/blob/main/src/utils/user_settings.py"
click node_session "https://github.com/absolutejekaii/akira/blob/main/src/utils/session_state.py"
click node_greeting "https://github.com/absolutejekaii/akira/blob/main/src/utils/greeting.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_desktop_app,node_gui_runner,node_hotkeys,node_trigger,node_user toneBlue
class node_wakeword,node_ambient,node_recorder,node_transcriber,node_stt_ensemble,node_stt_backends,node_tts,node_google_calendar toneAmber
class node_nlp_normalizer,node_nlp_intent,node_nlp_dates,node_nlp_entities,node_nlp_parser,node_nlp_reasoner,node_nlp_correction toneMint
class node_app,node_dialog_state,node_dialog_context,node_dialog_confirmation,node_calendar_executor,node_calendar_crud,node_calendar_auth,node_alarm,node_reminder,node_self_destruct toneRose
class node_settings,node_session,node_greeting,node_microphone toneIndigo
```

## Components

### Desktop controls

- [Desktop interface](https://github.com/absolutejekaii/akira/blob/main/akira_app.py): `akira_app.py`
- [GUI runner](https://github.com/absolutejekaii/akira/blob/main/src/gui/runner.py): `src/gui/runner.py`
- [Keyboard shortcuts](https://github.com/absolutejekaii/akira/blob/main/src/gui/hotkeys.py): `src/gui/hotkeys.py`
- [Input trigger queue](https://github.com/absolutejekaii/akira/blob/main/src/utils/trigger.py): `src/utils/trigger.py`

### Voice pipeline

- [Wake-word detector](https://github.com/absolutejekaii/akira/blob/main/src/wakeword/detector.py): `src/wakeword/detector.py`
- [Ambient listener](https://github.com/absolutejekaii/akira/blob/main/src/audio/ambient_listener.py): `src/audio/ambient_listener.py`
- [Audio recorder](https://github.com/absolutejekaii/akira/blob/main/src/audio/recorder.py): `src/audio/recorder.py`
- [STT orchestrator](https://github.com/absolutejekaii/akira/blob/main/src/stt/transcriber.py): `src/stt/transcriber.py`
- [STT ensemble](https://github.com/absolutejekaii/akira/blob/main/src/stt/ensemble.py): `src/stt/ensemble.py`
- [STT backends](https://github.com/absolutejekaii/akira/blob/main/src/stt/backends.py): `src/stt/backends.py`
- [Speech output](https://github.com/absolutejekaii/akira/blob/main/src/tts/speaker.py): `src/tts/speaker.py`

### Language understanding

- [Text normalizer](https://github.com/absolutejekaii/akira/blob/main/src/nlp/text_normalizer.py): `src/nlp/text_normalizer.py`
- [Intent classifier](https://github.com/absolutejekaii/akira/blob/main/src/nlp/intent_classifier.py): `src/nlp/intent_classifier.py`
- [Date-time parser](https://github.com/absolutejekaii/akira/blob/main/src/nlp/date_time_parser.py): `src/nlp/date_time_parser.py`
- [Entity extractor](https://github.com/absolutejekaii/akira/blob/main/src/nlp/slm_extractor.py): `src/nlp/slm_extractor.py`
- [NLP facade](https://github.com/absolutejekaii/akira/blob/main/src/nlp/parser.py): `src/nlp/parser.py`
- [LLM reasoner](https://github.com/absolutejekaii/akira/blob/main/src/nlp/groq_reasoner.py): `src/nlp/groq_reasoner.py`
- [Correction parser](https://github.com/absolutejekaii/akira/blob/main/src/nlp/correction.py): `src/nlp/correction.py`

### Dialog and calendar

- [Assistant orchestrator](https://github.com/absolutejekaii/akira/blob/main/src/app.py): `src/app.py`
- [Dialog state machine](https://github.com/absolutejekaii/akira/blob/main/src/dialog/state_machine.py): `src/dialog/state_machine.py`
- [Session context](https://github.com/absolutejekaii/akira/blob/main/src/dialog/context.py): `src/dialog/context.py`
- [Confirmation flow](https://github.com/absolutejekaii/akira/blob/main/src/dialog/confirmation.py): `src/dialog/confirmation.py`
- [Calendar executor](https://github.com/absolutejekaii/akira/blob/main/src/calendar_service/executor.py): `src/calendar_service/executor.py`
- [Calendar operations](https://github.com/absolutejekaii/akira/blob/main/src/calendar_service/crud.py): `src/calendar_service/crud.py`
- [Calendar authentication](https://github.com/absolutejekaii/akira/blob/main/src/calendar_service/auth.py): `src/calendar_service/auth.py`
- [Alarm and timer](https://github.com/absolutejekaii/akira/blob/main/src/dialog/alarm.py): `src/dialog/alarm.py`
- [Calendar reminders](https://github.com/absolutejekaii/akira/blob/main/src/dialog/reminder.py): `src/dialog/reminder.py`
- [Reminder lifecycle](https://github.com/absolutejekaii/akira/blob/main/src/dialog/self_destruct.py): `src/dialog/self_destruct.py`

### Session services

- [User settings](https://github.com/absolutejekaii/akira/blob/main/src/utils/user_settings.py): `src/utils/user_settings.py`
- [Session state](https://github.com/absolutejekaii/akira/blob/main/src/utils/session_state.py): `src/utils/session_state.py`
- [Greeting](https://github.com/absolutejekaii/akira/blob/main/src/utils/greeting.py): `src/utils/greeting.py`

### Other components

- **User**
- **Microphone**
- **Google Calendar API**

## Connections

- User → Microphone: speaks into
- Microphone → Wake-word detector: audio input
- Wake-word detector → Audio recorder: activates
- Wake-word detector → Ambient listener: enables listening (evidence: `src/audio/ambient_listener.py`)
- Ambient listener → Wake-word detector: uses detector (evidence: `src/audio/ambient_listener.py`)
- Audio recorder → STT orchestrator: recorded audio
- STT orchestrator → STT ensemble: transcribes with (evidence: `src/stt/transcriber.py`)
- STT ensemble → STT backends: runs engines (evidence: `src/stt/ensemble.py`)
- STT backends → User: audio transcription request
- Assistant orchestrator → Wake-word detector: monitors activation (evidence: `src/app.py`)
- Assistant orchestrator → Audio recorder: records speech (evidence: `src/app.py`)
- Assistant orchestrator → STT orchestrator: requests transcription (evidence: `src/app.py`)
- Assistant orchestrator → NLP facade: parses command (evidence: `src/app.py`)
- NLP facade → Text normalizer: normalizes text (evidence: `src/nlp/parser.py`)
- NLP facade → Intent classifier: classifies intent (evidence: `src/nlp/parser.py`)
- NLP facade → Date-time parser: parses dates (evidence: `src/nlp/parser.py`)
- NLP facade → Entity extractor: extracts entities (evidence: `src/nlp/parser.py`)
- NLP facade → Session context: uses context (evidence: `src/nlp/parser.py`)
- Intent classifier → LLM reasoner: reasons when needed (evidence: `src/nlp/intent_classifier.py`)
- Intent classifier → Entity extractor: uses extraction (evidence: `src/nlp/intent_classifier.py`)
- Assistant orchestrator → LLM reasoner: reconciles speech (evidence: `src/app.py`)
- Assistant orchestrator → Dialog state machine: runs dialog (evidence: `src/app.py`)
- Dialog state machine → NLP facade: parses replies (evidence: `src/dialog/state_machine.py`)
- Dialog state machine → LLM reasoner: interprets replies (evidence: `src/dialog/state_machine.py`)
- Assistant orchestrator → Confirmation flow: requests confirmation (evidence: `src/app.py`)
- Confirmation flow → Correction parser: parses corrections (evidence: `src/dialog/confirmation.py`)
- Correction parser → Date-time parser: parses corrected dates (evidence: `src/nlp/correction.py`)
- Assistant orchestrator → Calendar executor: executes confirmed action (evidence: `src/app.py`)
- Calendar executor → Calendar operations: dispatches operations (evidence: `src/calendar_service/executor.py`)
- Calendar operations → Calendar authentication: obtains credentials (evidence: `src/calendar_service/crud.py`)
- Calendar operations → Google Calendar API: reads and writes
- Assistant orchestrator → Alarm and timer: handles alarm requests (evidence: `src/app.py`)
- Assistant orchestrator → Calendar reminders: handles reminders (evidence: `src/app.py`)
- Calendar reminders → Calendar operations: stores reminders (evidence: `src/dialog/reminder.py`)
- Calendar reminders → Calendar executor: uses calendar actions (evidence: `src/dialog/reminder.py`)
- Assistant orchestrator → Reminder lifecycle: manages reminder lifecycle (evidence: `src/app.py`)
- Assistant orchestrator → Speech output: speaks responses (evidence: `src/app.py`)
- User → Desktop interface: uses desktop controls
- Desktop interface → GUI runner: starts assistant (evidence: `akira_app.py`)
- GUI runner → Assistant orchestrator: runs assistant (evidence: `src/gui/runner.py`)
- Desktop interface → Keyboard shortcuts: configures shortcuts (evidence: `akira_app.py`)
- Keyboard shortcuts → Input trigger queue: queues activation (evidence: `src/gui/hotkeys.py`)
- Desktop interface → Input trigger queue: queues typed commands (evidence: `akira_app.py`)
- Assistant orchestrator → Input trigger queue: checks queued inputs (evidence: `src/app.py`)
- Assistant orchestrator → User settings: loads preferences (evidence: `src/app.py`)
- Assistant orchestrator → Session state: tracks session (evidence: `src/app.py`)
- Assistant orchestrator → Greeting: greets user (evidence: `src/app.py`)
