# alexandresajus/jarvis architecture

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

- Interactive diagram: https://gitdiagram.com/alexandresajus/jarvis
- Repository: https://github.com/alexandresajus/jarvis

## Overview

JARVIS is a voice assistant with a separate Taipy conversation display. The principal workflow records speech, transcribes it through Deepgram, requests a GPT response, synthesizes speech with ElevenLabs, and plays it through Pygame; the assistant also writes conversation and status files for the display. The README documents these integrations, while the excerpts show their implementation and file handoffs. The UI refreshes from those files and can erase the conversation. The architecture below reflects the shown workflow; it does not assume unshown integration details.

Main entry points: [`main.py`](https://github.com/alexandresajus/jarvis/blob/main/main.py) (Assistant loop), [`display.py`](https://github.com/alexandresajus/jarvis/blob/main/display.py) (Taipy interface), [`record.py`](https://github.com/alexandresajus/jarvis/blob/main/record.py) (Speech recorder), [`conv.txt`](https://github.com/alexandresajus/jarvis/blob/main/conv.txt) (Conversation log)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_assistant["Voice assistant"]
  node_recorder["Speech recorder<br/>[record.py]"]
  node_main["Assistant loop<br/>[main.py]"]
  node_transcriber["Transcription<br/>[main.py]"]
  node_transcript["Transcript<br/>[conv.txt]"]
  node_chat["Response generation<br/>[main.py]"]
  node_speech["Speech synthesis<br/>[main.py]"]
  node_response_audio["Response audio"]
  node_player["Audio playback<br/>[main.py]"]
  node_conversation["Conversation log<br/>[conv.txt]"]
  node_status["Status file<br/>[status.txt]"]
end

subgraph group_display["Conversation display"]
  node_display_app["Taipy interface<br/>[display.py]"]
  node_erase["Erase action<br/>[display.py]"]
end

subgraph group_services["External services"]
  node_deepgram["Deepgram"]
  node_openai["OpenAI GPT"]
  node_elevenlabs["ElevenLabs"]
  node_pygame["Pygame audio"]
end

node_user(("User"))
node_mic(("Microphone"))
node_viewer(("Web user"))

node_user -->|"speaks into"| node_mic
node_mic -->|"captures audio"| node_recorder
node_main -->|"calls"| node_recorder
node_recorder -->|"saves recording"| node_transcriber
node_main -->|"transcribes"| node_transcriber
node_transcriber -->|"requests transcript"| node_deepgram
node_main -->|"appends text"| node_transcript
node_main -->|"requests response"| node_chat
node_chat -->|"calls"| node_openai
node_main -->|"synthesizes response"| node_speech
node_speech -->|"generates speech"| node_elevenlabs
node_speech -->|"saves audio"| node_response_audio
node_main -->|"plays response"| node_player
node_player -->|"uses"| node_pygame
node_main -->|"appends messages"| node_conversation
node_main -->|"writes status"| node_status
node_display_app -->|"reads periodically"| node_conversation
node_display_app -->|"reads status"| node_status
node_display_app -->|"displays conversation"| node_viewer
node_viewer -->|"requests reset"| node_erase
node_erase -->|"clears file"| node_conversation

click node_recorder "https://github.com/alexandresajus/jarvis/blob/main/record.py"
click node_main "https://github.com/alexandresajus/jarvis/blob/main/main.py"
click node_transcriber "https://github.com/alexandresajus/jarvis/blob/main/main.py"
click node_transcript "https://github.com/alexandresajus/jarvis/blob/main/conv.txt"
click node_chat "https://github.com/alexandresajus/jarvis/blob/main/main.py"
click node_speech "https://github.com/alexandresajus/jarvis/blob/main/main.py"
click node_response_audio "https://github.com/alexandresajus/jarvis/tree/main/audio"
click node_player "https://github.com/alexandresajus/jarvis/blob/main/main.py"
click node_conversation "https://github.com/alexandresajus/jarvis/blob/main/conv.txt"
click node_status "https://github.com/alexandresajus/jarvis/blob/main/status.txt"
click node_display_app "https://github.com/alexandresajus/jarvis/blob/main/display.py"
click node_erase "https://github.com/alexandresajus/jarvis/blob/main/display.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_recorder,node_main,node_transcriber,node_transcript,node_chat,node_speech,node_response_audio,node_player,node_conversation,node_status,node_user,node_viewer toneBlue
class node_display_app,node_erase toneAmber
class node_deepgram,node_openai,node_elevenlabs,node_pygame toneMint
class node_mic toneIndigo
```

## Components

### Voice assistant

- [Speech recorder](https://github.com/alexandresajus/jarvis/blob/main/record.py): `record.py`
- [Assistant loop](https://github.com/alexandresajus/jarvis/blob/main/main.py): `main.py`
- [Transcription](https://github.com/alexandresajus/jarvis/blob/main/main.py): `main.py`
- [Transcript](https://github.com/alexandresajus/jarvis/blob/main/conv.txt): `conv.txt`
- [Response generation](https://github.com/alexandresajus/jarvis/blob/main/main.py): `main.py`
- [Speech synthesis](https://github.com/alexandresajus/jarvis/blob/main/main.py): `main.py`
- [Response audio](https://github.com/alexandresajus/jarvis/tree/main/audio): `audio`
- [Audio playback](https://github.com/alexandresajus/jarvis/blob/main/main.py): `main.py`
- [Conversation log](https://github.com/alexandresajus/jarvis/blob/main/conv.txt): `conv.txt`
- [Status file](https://github.com/alexandresajus/jarvis/blob/main/status.txt): `status.txt`

### Conversation display

- [Taipy interface](https://github.com/alexandresajus/jarvis/blob/main/display.py): `display.py`
- [Erase action](https://github.com/alexandresajus/jarvis/blob/main/display.py): `display.py`

### External services

- **Deepgram**
- **OpenAI GPT**
- **ElevenLabs**
- **Pygame audio**

### Other components

- **User**
- **Microphone**
- **Web user**

## Connections

- User → Microphone: speaks into (evidence: `README.md`)
- Microphone → Speech recorder: captures audio (evidence: `README.md`)
- Assistant loop → Speech recorder: calls (evidence: `main.py`)
- Speech recorder → Transcription: saves recording (evidence: `record.py`)
- Assistant loop → Transcription: transcribes (evidence: `main.py`)
- Transcription → Deepgram: requests transcript (evidence: `main.py`)
- Assistant loop → Transcript: appends text (evidence: `main.py`)
- Assistant loop → Response generation: requests response (evidence: `main.py`)
- Response generation → OpenAI GPT: calls (evidence: `main.py`)
- Assistant loop → Speech synthesis: synthesizes response (evidence: `main.py`)
- Speech synthesis → ElevenLabs: generates speech (evidence: `main.py`)
- Speech synthesis → Response audio: saves audio (evidence: `main.py`)
- Assistant loop → Audio playback: plays response (evidence: `main.py`)
- Audio playback → Pygame audio: uses (evidence: `main.py`)
- Assistant loop → Conversation log: appends messages (evidence: `main.py`)
- Assistant loop → Status file: writes status (evidence: `main.py`)
- Taipy interface → Conversation log: reads periodically (evidence: `display.py`)
- Taipy interface → Status file: reads status (evidence: `display.py`)
- Taipy interface → Web user: displays conversation (evidence: `README.md`)
- Web user → Erase action: requests reset (evidence: `display.py`)
- Erase action → Conversation log: clears file (evidence: `display.py`)
