How aayush-js/offline-voice-assistant works
Offline Voice Assistant converts microphone speech to text, predicts an intent with its bundled classifier, dispatches a supported action, and speaks the response. The main loop also handles first-run name setup and rejects low-confidence predictions. Training from the command dataset is a separate model-preparation path. The README documents the supported action set; the source excerpts show the runtime dispatch and integrations. The graph omits unshown classifier internals and treats the operating-system and browser effects as external.
Main entry points: main.py Assistant loop · actions.py Action dispatcher · user.py Name profile · train.py Model training
Components 18
Voice interaction
- Assistant loop
main.py - Speech recognition
stt.py - Voice response
tts.py
Intent model
- Intent prediction
main.py - Trained model
intent_model.pkl - Model training
train.py - Command dataset
dataset.csv
Command actions
- Action dispatcher
actions.py - Personal greeting
actions.py - Time and date
actions.py - App launcher
actions.py - Web search
actions.py - Help and exit
actions.py
Local state and integrations
- Name profile
user.py - Name storage
user_data.json
Other components
- Speaker
- Windows apps
- Default browser
Connections 18
- Speaker → Speech recognition: speaks to
README.md - Assistant loop → Speech recognition: listens and calibrates
main.py - Assistant loop → Intent prediction: predicts intent
main.py - Assistant loop → Trained model: loads
main.py - Model training → Command dataset: reads
train.py - Model training → Trained model: saves
train.py - Assistant loop → Action dispatcher: dispatches intent
main.py - Assistant loop → Voice response: speaks response
main.py - Action dispatcher → Personal greeting: dispatches
actions.py - Action dispatcher → Time and date: dispatches
actions.py - Action dispatcher → App launcher: dispatches
actions.py - Action dispatcher → Web search: dispatches
actions.py - Action dispatcher → Help and exit: dispatches
actions.py - Personal greeting → Name profile: gets name
actions.py - Assistant loop → Name profile: gets and saves name
main.py - Name profile → Name storage: reads and writes
user.py - App launcher → Windows apps: launches
actions.py - Web search → Default browser: opens search
actions.py