Skip to content

aryanguptacsvtu/NEXUS--The-Voice-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Typing SVG


🤖 Nexus A.I. -- Intelligent Voice Assistant

Python Version Platform Groq AI License Category


🧠 About the Project

Nexus A.I. is a powerful desktop voice assistant that understands your commands and performs multiple tasks - from chatting intelligently and fetching weather reports to reading the latest news, opening apps/websites, playing music, taking screenshots, and more - all through your voice.

It combines the power of Speech Recognition, Groq AI, and Windows Automation to deliver a smooth, conversational, and hands-free experience.


✨ Features

AI Chat Integration (Groq API) – Get intelligent, human-like responses to your queries.
🌤 Weather Updates – Get real-time weather information for any city using the OpenWeatherMap API.
📰 Latest News – Fetch top news headlines from NewsAPI based on your chosen topic.
🎶 Music Player – Play your favorite song from a local path via a simple voice command.
🕒 Time Updates – Ask the current time anytime.
📸 Screenshots – Take and save screenshots instantly.
🧮 Applications Access – Open essential Windows utilities via voice.
🌐 Website Shortcuts – Quickly open popular sites like YouTube, Google, Wikipedia, etc.
💬 Persistent Logging – Every conversation (user prompt + AI response) is stored in responses.txt.
🔊 Speech Synthesis & Recognition – Powered by Microsoft SAPI and Google Speech Recognition.
🧠 Threaded Asynchronous Speech – Speak and listen simultaneously with smooth execution.


🏗️ System Architecture

graph TD
    A[🎤 User Voice Input] --> B[Speech Recognition]
    B --> C{Command Detection}
    
    C -->|Weather Query| D[🌤️ OpenWeatherMap API]
    C -->|News Query| E[📰 NewsAPI]
    C -->|AI Chat| F[🤖 Groq LLaMA 3.1]
    C -->|Website| G[🌐 Web Browser]
    C -->|Music| H[🎵 Music Player]
    C -->|Screenshot| I[📸 PyAutoGUI]
    C -->|App Control| J[💻 Windows Apps]
    C -->|Time| K[🕒 System Time]
    
    D --> L[Response Generation]
    E --> L
    G --> L
    H --> L
    I --> L
    J --> L
    K --> L
    
    F --> M[📝 Log to responses.txt]
    M --> L
    
    L --> N[🔊 Text-to-Speech]
    N --> O[✨ Voice Output]
    
    style A fill:#00FFFF,stroke:#0080FF,stroke-width:3px,color:#000
    style O fill:#00FF00,stroke:#008000,stroke-width:3px,color:#000
    style F fill:#FF6B35,stroke:#C23B00,stroke-width:2px
    style C fill:#FFD700,stroke:#FFA500,stroke-width:2px
    style L fill:#9D4EDD,stroke:#7209B7,stroke-width:2px
Loading

🧩 Tech Stack

Component Technology Used
Programming Language Python
AI Model Groq LLaMA 3.1 8B Instant
Speech Recognition speech_recognition (Google API)
Text-to-Speech Engine Microsoft SAPI (via win32com.client)
Weather Data OpenWeatherMap API
News Data NewsAPI
Automation pyautogui
Environment Management python-dotenv
Threading threading, pythoncom

⚙️ Installation & Setup

1. Clone the Repository

git clone https://github.com/your-username/Nexus-AI-Voice-Assistant.git
cd Nexus-AI-Voice-Assistant

2. Create a Virtual Environment (Recommended)

python -m venv venv
venv\Scripts\activate  # For Windows

3. Install Dependencies

pip install -r requirements.txt

4. Configure Environment Variables

Create a .env file in the project directory and add your API keys:

GROQ_API_KEY = your_groq_api_key
WEATHER_API_KEY = your_openweather_api_key
NEWS_API_KEY = your_newsapi_key

💡 You can obtain:


▶️ Usage :

Run the assistant with:

python main.py

When you see “🔊 Listening...”, speak any of these commands:

🗣 Example Commands:

  • “What’s the weather in Delhi?”

  • “Tell me the latest news about Indian politics.”

  • “Open YouTube.”

  • “Play music.”

  • “Take a screenshot.”

  • “What time is it?”

  • “Use AI to explain black holes.”

  • “Chat with me.”

Say “quit” anytime to exit 👋


🧠 How It Works

  1. Speech Recognition: Captures your voice and converts it to text.

  2. Intent Detection: Identifies what you’re asking (e.g., weather, news, chat).

  3. Task Execution: Calls APIs or OS-level commands accordingly.

  4. Response Generation: Uses the Groq LLaMA model to generate conversational replies.

  5. Speech Output: Converts the AI's response back into voice using Microsoft SAPI.


🔒 Error Handling

  • Handles speech recognition failures gracefully.
  • Catches API timeouts or invalid responses.
  • Automatically logs activity for debugging and record-keeping.

👨‍💻 Author

Aryan Gupta
📍 Bhilai, Chhattisgarh
🔗 GitHub Profile


⭐ Support

If you like this project, leave a ⭐ and share it with others!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages