How aric-davison/llmbot works
LLMbot is a local AI-powered Discord voice bot. A user joins a voice channel, speaks, and receives a spoken response: voice capture and VAD produce audio for the STT → LLM → TTS pipeline, whose output is played back into the channel. The graph preserves the documented model lifecycle and conversation memory alongside voice management, playback, state, and file cleanup. Relationships for unsampled modules are included only where the README or SOURCE INDEX supports them; implementation details beyond the excerpts are not assumed.
Main entry points: pipelineOrchestrator.js Pipeline orchestration · voiceManager.js Voice lifecycle · config.js Configuration · whisperService.js Speech recognition
Components 18
Discord and Voice
- Join and leave
src/commands - Discord gateway
src/services/discordClient.js - Voice lifecycle
src/services/voiceManager.js - VAD and capture
src/services/audioProcessor.js - Audio playback
src/services/audioPlaybackService.js
Conversation Pipeline
- Pipeline orchestration
src/services/pipelineOrchestrator.js - Conversation memory
src/services/conversationManager.js - Voice state
src/services/stateMachine.js
Local AI Models
- Speech recognition
src/services/whisperService.js - LLM queries
src/services/llamaCppClient.js - LLM server lifecycle
src/services/llamaServer.js - Speech synthesis
src/services/xttsService.js
Runtime Support
- Audio file lifecycle
src/utils/audioFileManager.js - Configuration
src/utils/config.js - Error monitoring
src/utils/errorMonitor.js - Structured errors
src/utils/errorLogger.js - Structured logging
src/utils/logger.js
Other components
- Voice participant
Connections 24
- Voice participant → Join and leave: issues commands
README.md - Join and leave → Voice lifecycle: joins or leaves
README.md - Voice participant → Voice lifecycle: speaks in channel
README.md - Discord gateway → Voice lifecycle: manages voice
README.md - Voice lifecycle → VAD and capture: captures audio
src/services/voiceManager.js - VAD and capture → Pipeline orchestration: signals speech end
- Pipeline orchestration → Speech recognition: transcribes audio
README.md - Pipeline orchestration → LLM queries: queries model
README.md - Pipeline orchestration → Conversation memory: uses conversation context
README.md - Pipeline orchestration → Speech synthesis: synthesizes response
README.md - Pipeline orchestration → Audio playback: plays generated audio
README.md - Voice lifecycle → Audio playback: initializes playback
src/services/voiceManager.js - Voice lifecycle → Voice state: changes voice state
src/services/voiceManager.js - Pipeline orchestration → Voice state: coordinates pipeline state
- LLM server lifecycle → LLM queries: serves model queries
src/services/llamaServer.js - Audio playback → Audio file lifecycle: cleans up audio
src/services/audioPlaybackService.js - Speech recognition → Audio file lifecycle: validates WAV
src/services/whisperService.js - Pipeline orchestration → Error monitoring: tracks pipeline errors
src/services/pipelineOrchestrator.js - Pipeline orchestration → Structured errors: records structured errors
src/services/pipelineOrchestrator.js - Pipeline orchestration → Configuration: reads settings
src/services/pipelineOrchestrator.js - Voice lifecycle → Configuration: reads settings
src/services/voiceManager.js - Speech recognition → Configuration: reads settings
src/services/whisperService.js - Speech synthesis → Configuration: reads settings
src/services/xttsService.js - LLM queries → Configuration: reads settings
src/services/llamaCppClient.js