An intelligent, voice-activated AI assistant for Linux desktop environments that combines advanced AI capabilities with seamless system integration. Built with modern technologies including LangChain, Groq API, and PyQt5 for a responsive and intuitive user experience.
- Wake Word Detection: Responds to "Jasper" using Porcupine wake word engine
- Speaker Verification: Uses Resemblyzer for owner voice recognition and security
- Voice Activity Detection: Intelligent speech detection with Silero VAD
- High-Quality Speech Recognition: Groq Whisper API for accurate transcription
- LangChain Integration: Advanced conversational AI with tool usage capabilities
- Multiple LLM Support: Compatible with Groq, Anthropic, and other providers
- Conversation Memory: Persistent chat history with SQLite checkpoints
- Context Summarization: Automatic conversation summarization for long interactions
- Intelligent Tool Selection: React agent that chooses appropriate tools automatically
- Shell Command Execution: Run any Linux command via voice
- Browser Control: Open Chrome with specific URLs or in new windows
- Application Launching: Quick access to web applications
- Screenshot Capabilities: Take and analyze screen captures
- System Monitoring: Real-time status updates and logging
- Transparent Overlay: PyQt5-based floating window with transparency
- Real-time Status: Visual indicators for listening, processing, and responding states
- Message History: Scrollable conversation log with user/assistant distinction
- Text Input: Alternative text-based interaction alongside voice
- Draggable Interface: Repositionable overlay window
- Modular Architecture: Clean separation of concerns with organized components
- Thread-Safe Operations: Concurrent processing for responsive performance
- Comprehensive Logging: Detailed logs for debugging and monitoring
- Environment-Based Config: Flexible configuration via environment variables
- Personalizable: Customize the assistant's name and personality via config
- Operating System: Linux (tested on Arch Linux, Ubuntu, Fedora)
- Python: 3.12 or higher
- Audio: Working microphone and speakers/headphones
- Display: X11 or Wayland with Qt support
- Groq API Key: For Whisper transcription and LLM inference
- Porcupine Access Key: For wake word detection (free tier available)
- Anthropic API Key: Alternative LLM provider
- Google API Key: For additional services (if needed)
- Tavily API Key: For web search functionality
git clone https://github.com/Harshbansal8705/DesktopAI.git
cd DesktopAIuv synccp .env.example .envEdit .env and add your API keys. At minimum you'll need GROQ_API_KEY and PORCUPINE_ACCESS_KEY. You can also customize the assistant by setting the personalization fields (ASSISTANT_NAME, OWNER_NAME, etc.).
# Record your voice for speaker verification
python setup/record_owner_voice.pyFollow the prompts to record 20 seconds of your voice. This creates a voice profile for security.
chmod +x run.sh# Using the run script (recommended)
./run.sh
# Or manually
QT_QPA_PLATFORM=xcb uv run python main.py- Wake Up: Say "Jasper" clearly
- Wait for Confirmation: Listen for the start sound
- Speak Your Command: Give your instruction naturally
- Listen for Response: Desktop Assistant will respond with both voice and text
"Jasper, what's the current time?"
"Jasper, open Chrome and go to GitHub"
"Jasper, run ls -la in the terminal"
"Jasper, take a screenshot"
"Jasper, what's the weather today?"
"Jasper, help me write a Python script"
- Use the text input box in the overlay for silent interaction
- Type your message and press Enter or click Send
- Useful in quiet environments or when microphone is unavailable
- run_command: Execute any shell command on your Linux system
- get_screenshot: Capture and analyze current screen content
- open_google_chrome: Launch Chrome browser with optional URL
- open_whatsapp_web: Open WhatsApp Web application
- show_popup_widget: Display the overlay interface
- hide_popup_widget: Hide the overlay interface
- exit_assistant: Safely shutdown the assistant
- web_search: Search the web using Tavily API
- mirror_mobile: Mirror mobile screen or camera via scrcpy
- get_location: Get location from connected Android device
- do_nothing: No-operation function for when no action is needed
DesktopAI/
βββ main.py # Application entry point
βββ run.sh # Startup script
βββ pyproject.toml # Project metadata, dependencies & ruff config
βββ uv.lock # Lockfile for reproducible installs (uv)
βββ .env.example # Template for environment variables
βββ architecture.png # Architecture diagram
βββ LICENSE # MIT license
βββ README.md # This documentation
βββ CONTRIBUTING.md # Contribution guidelines
βββ CODE_OF_CONDUCT.md # Community code of conduct
β
βββ src/ # Source code directory
β βββ __init__.py
β βββ config.py # Configuration management
β β
β βββ core/ # Core AI components
β β βββ __init__.py
β β βββ assistant.py # Main LangGraph ReAct agent
β β βββ llm.py # LLM provider setup
β β βββ generate_prompt.py # System prompt generation
β β βββ summarizer.py # Conversation summarization
β β βββ tools.py # System integration tools
β β
β βββ audio/ # Audio processing components
β β βββ __init__.py
β β βββ listener.py # Voice listener with wake word
β β βββ vad.py # Voice activity detection (standalone, future use)
β β βββ audio_processor.py # Audio transcription
β β βββ ttsplayer.py # Text-to-speech
β β
β βββ ui/ # User interface components
β β βββ __init__.py
β β βββ overlay.py # PyQt5 transparent overlay
β β
β βββ utils/ # Utility modules
β βββ __init__.py
β βββ logger.py # Logging configuration
β βββ thread_executor.py # Thread pool management
β
βββ setup/ # Setup and configuration scripts
β βββ record_owner_voice.py # Voice profile recording
β
βββ data/ # Data files
β βββ owner.wav # Owner voice profile (created during setup)
β βββ soundeffects/ # Audio feedback sounds
β βββ start_recording.mp3
β βββ stop_recording.mp3
β
βββ wakewordmodels/ # Wake word detection models
β βββ Jasper_en_linux_v3_0_0.ppn
β
βββ .github/ # GitHub templates and workflows
β βββ ISSUE_TEMPLATE/
β β βββ bug_report.md
β β βββ feature_request.md
β βββ PULL_REQUEST_TEMPLATE.md
β βββ workflows/
β βββ lint.yml
β
βββ logs/ # Application logs (created at runtime)
βββ checkpoints/ # Conversation memory (created at runtime)
All configuration is managed through environment variables (.env file) and src/config.py.
# In your .env file
ASSISTANT_NAME="Jasper" # Your assistant's name
OWNER_NAME="Your Name" # Your name
OWNER_AGE="25" # Your age (optional)
OWNER_LOCATION="India" # Your location (optional)
OWNER_OCCUPATION="Student" # Your occupation (optional)
OWNER_COLLEGE="MIT" # Your college (optional)
OWNER_INTERESTS="AI, Music" # Your interests (optional)# Audio configuration in src/config.py
SAMPLE_RATE = 16000 # Audio sample rate
CHANNELS = 1 # Mono audio
CONFIDENCE_THRESHOLD = 0.5 # VAD sensitivity
MAX_SILENCE_FRAMES = 60 # Stop recording after silence
SPEAKER_SIMILARITY_THRESHOLD = 0.6 # Voice verification threshold# In your .env file (or defaults in config.py)
LLM_MODEL="meta-llama/llama-4-scout-17b-16e-instruct"
LLM_PROVIDER="groq"
LLM_TEMPERATURE=0.8# Interface settings in src/config.py
OVERLAY_WIDTH = 400
OVERLAY_HEIGHT = 200
OVERLAY_X = 50 # Default position
OVERLAY_Y = 50
MESSAGE_TIMEOUT = 5 # Auto-hide timeoutAdd new tools by editing src/core/tools.py:
@tool
def my_custom_tool(parameter: str) -> str:
"""Description of what this tool does."""
# Your implementation here
return "Tool result"The @tool decorator automatically registers and adds logging to your tool. See CONTRIBUTING.md for more details.
Set environment variables to use different providers:
LLM_MODEL="your-model-name"
LLM_PROVIDER="your-provider"Or modify src/core/llm.py directly for more control.
We welcome contributions! Whether it's bug reports, feature requests, or code contributions, every bit helps.
Please read our Contributing Guide before submitting a PR.
See the open issues for a list of known issues and planned features.
This project follows the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.
This project is licensed under the MIT License - see the LICENSE file for details.
- Porcupine by Picovoice for wake word detection
- Groq for fast LLM inference and Whisper API
- LangChain for AI agent framework
- PyQt5 for the user interface
- Edge TTS for text-to-speech synthesis
- Resemblyzer for speaker verification
For issues, questions, or contributions:
- GitHub Issues: Report bugs or request features
- Email: harsh@harshbansal.in
Made with β€οΈ by Harsh Bansal
