This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Trixy is a professional voice assistant system written in Python 3.10+ with PyTorch. It operates in four modes:
# Server mode
python3 main.py server [--debug] [--config config/server_config.json]
# Client/Satellite mode
python3 main.py client --host <server_ip> --port 2101 --room <room> --alias <name> [--debug]
# Standalone mode
python3 main.py standalone [--debug] [--config config/standalone_config.json]
# ML Training
python3 main.py train [wakeword|voice-recognition|all]
The --debug flag enables stdout output via print() instead of TUI logging.
All major components inherit from IService with:
PRIORITY: ServicePriority enum (CRITICAL, CORE, NETWORK, MANAGER, PLUGIN, OPTIONAL)GROUP: ServiceGroup for categorizationDEPENDENCIES: List of required service nameson_pre_start(), on_post_start(), on_pre_stop(), on_post_stop(), on_dependency_ready()Central pub/sub with priority levels (SYSTEM, HIGHEST, HIGH, NORMAL, LOW, LOWEST, MONITOR):
@TrixyEvent(["wakeword_received"])
def on_wakeword(self, event_name, event_data):
pass
Events are cancellable and support async handlers.
Custom binary protocol on 4 ports:
Protocol structure: Magic TRXI + version + datetime + 32-bit flags + MD5 checksum + class name + serialized data
Hard-coded commands for efficiency: TRXINOOP, TRXIPING, TRXIPONG, TRXIPRNT, TRXYHELO
./satellites/./
├── main.py # Entry point
├── config/ # Configuration files (server/client/standalone/trainer)
├── trixy_core/ # Core framework
│ ├── service/ # Service container and IService base
│ ├── events/ # EventManager and event data classes
│ ├── network/ # Protocol, encryption, sockets, cmd/ messages
│ ├── satellite/ # SatelliteManager, registration, heartbeat
│ ├── config/ # ConfigManager with typed dataclasses
│ ├── wakeword/ # Wakeword detection service (client-side)
│ ├── plugins/ # Plugin system
│ ├── scheduler/ # Schedule triggers and actions
│ ├── conversation/ # Conversation state management
│ ├── tui/ # Textual-based UI framework
│ └── utils/ # pinfo(), pdebug(), perror(), pwarn()
├── plugins/ # User plugins (each in own directory with main.py + config.json)
├── models/ # ML models
│ ├── wakeword/{model}/ # model.pth, model.onnx, model.pt, metafile.json
│ └── voice_recognition/{model}/
├── trainer/
│ ├── data/{wakeword|voice_recognition}/raw/ # Raw training data
│ └── trainers/ # Trainer implementations
├── assets/{profile}/ # Audio files, profiles (with "default" fallback)
├── satellites/ # Registered satellite JSON files
├── certs/ # SSL certificates
└── logs/ # Application logs
pinfo(), pdebug(), perror(), pwarn() from trixy_core.utils.debugPlugins extend TrixyPlugin and must have:
main.py with plugin classconfig.json for configurationPlugin class has access to: self.application, self.config, self.enabled, reload_config(), save_config()
metafile.json includes training info, speaker names, architecture versionAudio specs: 16KHz, 16-bit PCM mono, Log-Mel-Spectrogram features
raw_audio_input_received event → STT → NLP → intent handlingDas Projekt nutzt ein strukturiertes Memory-System in docs/project_notes/:
| Datei | Zweck |
|---|---|
bugs.md |
Bug-Log mit Ursachen und Lösungen |
decisions.md |
Architekturentscheidungen (ADRs) mit Kontext |
key_facts.md |
Projektkonfiguration und Referenzinformationen |
issues.md |
Work-Log abgeschlossener Arbeiten |
Bei Bug-Fixes:
docs/project_notes/bugs.md hinzufügenBei Architekturentscheidungen:
docs/project_notes/decisions.md hinzufügenBei abgeschlossenen Tickets/Features:
docs/project_notes/issues.md hinzufügenBei Konfigurationsänderungen:
docs/project_notes/key_facts.md aktualisieren