Skip to content

Real-time AI ChatBot and voice-enabled AI VoiceBot using Deepgram (STT ↔ TTS) and Groq LLM for natural conversations.

Notifications You must be signed in to change notification settings

Sharan-Kumar-R/Voice-Chat-Bot

Repository files navigation

Real-time AI ChatBot and voice-enabled AI VoiceBot


Python LangChain Groq OpenAI Deepgram


🔊 Real-Time Voice AI Assistant using Groq LLaMA3 + Deepgram + LangChain .

This project is a real-time voice-based conversational AI assistant that integrates:

🧠 Groq’s LLaMA3 (via LangChain) for ultra-fast, high-quality conversational intelligence

🎙️ Deepgram STT (Speech-to-Text) for real-time transcription from microphone input

🗣️ Deepgram TTS (Text-to-Speech) for fast and natural voice responses using ffplay

Core components such as LLM (Large Language Model), STT (Speech to Text Model), TTS (Text to Speech Model), and the overall Chatbot architecture have also been documented to support comprehensive understanding and customization.

Features

  • Real-time voice recognition using Deepgram
  • AI-powered responses via Groq LLM
  • Easy setup with virtual environment
  • Cross-platform compatibility

Installation

Step 1: Clone the Repository

Option A: Using VS Code Terminal

  1. Open Visual Studio Code
  2. Open a new terminal (Terminal → New Terminal or `Ctrl+Shift+`` )
  3. Navigate to your desired directory:
    cd path/to/your/desired/folder
  4. Clone the repository:
    git clone https://github.com/Sharan-Kumar-R/Voice-Chat-Bot.git
  5. Open the project folder:
    cd Voice-Chat-Bot
  6. Open the project in VS Code:
    code .

Option B: Using VS Code Git Integration

  1. Open Visual Studio Code
  2. Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac)
  3. Type "Git: Clone" and select it
  4. Paste the repository URL: https://github.com/Sharan-Kumar-R/Voice-Chat-Bot.git
  5. Choose a folder location and click "Select Repository Location"
  6. Click "Open" when prompted

Step 2: Install FFmpeg

  1. Visit FFmpeg Download Page
  2. Download the appropriate version for your operating system
  3. Follow the installation instructions for your platform
  4. Verify the installation by opening a terminal/command prompt and typing:
    ffmpeg -version
    If FFmpeg is properly installed, you should see version information displayed.

Step 3: Create Virtual Environment

Open a terminal in Visual Studio Code and run:

python -m venv myenv

Step 4: Activate Virtual Environment

For Windows:

myenv\Scripts\activate

For macOS/Linux:

source myenv/bin/activate

After activation, you should see something like this in your terminal:

(myenv) PS C:\Users\username\path\to\project>

Step 5: Install Dependencies

pip install -r requirements.txt

API Setup

1. Groq API Key

  1. Visit Groq Console
  2. Create an account or sign in
  3. Generate a new API key
  4. Copy the API key for later use

2. Deepgram API Key

  1. Visit Deepgram Console
  2. Create an account or sign in
  3. Generate a new API key
  4. Copy the API key for later use

3. Environment Configuration

Update the .env file in the project root directory and add your API keys (replace if already exists):

GROQ_API_KEY=your_groq_api_key_here
DEEPGRAM_API_KEY=your_deepgram_api_key_here

Important: Replace your_groq_api_key_here and your_deepgram_api_key_here with your actual API keys.

Usage

Running the Voice Bot

  1. Make sure your virtual environment is activated:

    myenv\Scripts\activate
  2. Run the main voice bot application:

    python Voice_Bot.py
  3. Start talking! The bot will:

    • Listen to your voice input
    • Process it through Groq LLaMA3
    • Respond with natural speech

Customizing the Bot

To customize the bot's behavior, such as naming the model and defining its function, edit the Bot_prompt.txt file.

Running Other Scripts

To run any other Python file in the project:

python <filename>.py

Deactivating the Environment

When you're done working with the project, deactivate the virtual environment:

deactivate

Troubleshooting

  • Ensure your API keys are correctly set in the .env file
  • Make sure your virtual environment is activated before running any scripts
  • Check that all dependencies are installed with pip list
  • Verify your internet connection for API services
  • FFmpeg Issues: If you encounter audio-related errors, verify FFmpeg installation with ffmpeg --version

Project Structure

Voice-Chat-Bot/
├── .env                     # Environment variables (API keys)
├── Chat_Bot.py              # Chat bot implementation
├── llm.py                   # Language model integration
├── Voice_Bot.py             # Main voice bot application
├── README.md                # This documentation
├── requirements.txt         # Python dependencies
├── speech_to_text.py        # Speech-to-text streaming functionality
├── Bot_prompt.txt           # System prompt configuration
├── text_to_speech.py        # Text-to-speech functionality
└── myenv/                   # Virtual environment folder (created during setup)

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

In case of any queries, please leave a message or contact me via the email provided in my profile.

Star this repository if you found it helpful!

About

Real-time AI ChatBot and voice-enabled AI VoiceBot using Deepgram (STT ↔ TTS) and Groq LLM for natural conversations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages