How shivam1981-leo/jarvis-agentic-ai-voice-assistant works
Purpose and Entry Point
This is a Windows-focused autonomous voice desktop assistant. Its single apparent application entry point is main.py; the README’s python jarvis.py command does not match the supplied tree. The assistant combines local speech recognition, local Ollama reasoning/tool calls, desktop automation, speech output, and a Pygame holographic interface.
Relevant paths: main.py, requirements.txt, README.md.
Runtime Topology
The process is a Python 3.10+ desktop runtime with concurrent UI, agent, audio, and background-task work. It requires an NVIDIA CUDA-capable GPU for Faster-Whisper, local Ollama services/models for reasoning and vision, and Windows-specific desktop/system command support.
Relevant paths: main.py, requirements.txt.
Voice Interaction Pipeline
The primary interactive flow is microphone capture → Whisper large-v3 transcription with VAD/artifact filtering → wake-word or command interpretation → agent processing. During TTS playback, a concurrent listener recognizes interruption terms such as stop/quiet/cancel and cancels output, returning control to listening.
Relevant paths: main.py, startup.mp3, temp_voice_1107.mp3.
Agent and Tool-Execution Boundary
A local Ollama llama3.2 agent runs a bounded multi-round loop (up to five rounds): it receives user text plus prior tool observations, selects tools, executes them—potentially in parallel—and uses results to decide whether to continue or answer. Tool implementations and dynamically created tools are centered in custom_tools.py, separating privileged system/network actions from agent orchestration.
Relevant paths: main.py, custom_tools.py.
Desktop, Web, and Communication Capabilities
The tool layer spans Windows application/process control, terminal commands, keyboard/mouse automation, screenshots/OCR/window inspection, file writing, web/DuckDuckGo/Wikipedia retrieval, WhatsApp automation, and Gmail SMTP. These are high-privilege boundaries: model-produced tool arguments can affect the local machine, files, browser, and external communications.
Relevant paths: custom_tools.py, word.txt.
State, Background Work, and Persistence
Shared assistant state is intended to coordinate visual state, speech interruption, tool status, idle behavior, and asynchronous completion announcements using locks, queues, and thread pools. Persistent user memory is stored in the repository-root JSON file; tool-generated speech audio is written as transient temp_voice_*.mp3 files.
Relevant paths: main.py, memory.json, temp_voice_9950.mp3.
UI and External Services
Pygame renders the live 60-FPS “arc reactor” UI and displays listening/thinking/speaking/task states. External dependencies include Microsoft Edge TTS, Ollama (llama3.2, optional llava screen vision), wttr.in weather, DuckDuckGo, Wikipedia/web targets, Gmail SMTP credentials from .env, and WhatsApp Web login.
Relevant paths: main.py, requirements.txt, startup.mp3.
Main entry points: main.py Bounded agent loop · custom_tools.py Tool implementations · memory.json User memory · temp_voice_9950.mp3 Transient audio
Components 18
Desktop Runtime
Windows Python assistant process.
- Application entry · Starts UI, audio, agent, and background work.
main.py - Arc reactor UI · Renders live assistant states at 60 FPS.
main.py - Shared state · Coordinates visual, speech, tool, idle, and task state.
main.py - Microphone capture
main.py - Whisper transcription · Uses large-v3 with VAD and artifact filtering.
main.py - Wake word & commands
main.py - Speech output · Supports concurrent stop, quiet, and cancel interruption.
main.py - Background tasks · Runs asynchronous work and completion announcements.
main.py - User memory
memory.json - Transient audio · Generated tool speech output.
temp_voice_9950.mp3
Agent & Tools
Local reasoning and privileged actions.
- Bounded agent loop · Makes up to five reasoning and tool-use rounds.
main.py - Tool implementations · Executes model-selected local and external actions.
custom_tools.py - Desktop automation · Controls processes, terminal, input, windows, screenshots, OCR, and files.
custom_tools.py - Web & communications · Retrieves web data and automates WhatsApp and Gmail.
custom_tools.py
External Services
Local models and network-backed integrations.
- Ollama models · Runs llama3.2 and optional llava screen vision.
- Microsoft Edge TTS
- Web information services · Includes wttr.in, DuckDuckGo, Wikipedia, and web targets.
- Messaging services · Uses Gmail SMTP credentials and WhatsApp Web login.
Connections 22
- Application entry → Arc reactor UI: starts
- Application entry → Microphone capture: starts
- Application entry → Bounded agent loop: starts
- Application entry → Background tasks: creates
- Microphone capture → Whisper transcription: audio
- Whisper transcription → Wake word & commands: text
- Wake word & commands → Bounded agent loop: user request
- Bounded agent loop → Ollama models: reasoning and vision
- Bounded agent loop → Tool implementations: tool calls
- Tool implementations → Desktop automation: local actions
- Tool implementations → Web & communications: network actions
- Desktop automation → User memory: reads and writes
- Web & communications → Web information services: retrieval
- Web & communications → Messaging services: messages
- Tool implementations → Background tasks: parallel execution
- Bounded agent loop → Speech output: response
- Speech output → Microsoft Edge TTS: synthesis
- Speech output → Transient audio: writes
- Microphone capture → Speech output: interruptions
- Shared state → Arc reactor UI: display state
- Bounded agent loop → Shared state: updates status
- Background tasks → Speech output: completion announcements