Skip to content

asthasingh0660/HuggingFace_voice_customer_support_agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ™ HuggingFace Voice Customer Support Agent

Python Streamlit License

An AI-powered Retrieval-Augmented Generation (RAG) customer support agent that delivers documentation-grounded answers using multiple LLM providers, conversational memory, and optional voice synthesis.

This project simulates a production-grade technical support system capable of retrieving relevant documentation context, generating structured responses, and optionally delivering concise voice summaries.


πŸš€ Live Demo

Deployed Version (Text-based):

https://hugging-face-voice-customer-support-agent.streamlit.app/

Full Voice Demo (YouTube):

(https://youtu.be/hWOiNcBGIUI)


✨ Key Features

πŸ”Ž Retrieval-Augmented Generation (RAG)

  • Hybrid semantic + keyword retrieval
  • Embeddings via SentenceTransformers (all-MiniLM-L6-v2)
  • Cosine similarity scoring
  • Keyword boosting for procedural queries
  • Dynamic context injection into LLM prompt

πŸ€– Multi-LLM Support

Supports runtime switching between:

  • Groq (LLaMA / Mixtral)
  • OpenAI (GPT models)
  • Gemini (Flash models)

Enables:

  • Provider comparison
  • Rate-limit handling
  • Model abstraction architecture

🧠 Conversational Memory

  • Maintains last N conversation turns
  • Injects structured chat history into prompts
  • Enables context-aware follow-up responses

🎯 Professional Prompt Engineering

  • Support-oriented tone
  • Structured step-by-step guidance
  • Context-restricted generation
  • Voice-optimized summarization layer

πŸ”Š Voice Synthesis (Local Environment)

  • ElevenLabs TTS integration
  • Concise conversational summary generation
  • Production-safe fallback handling

Note: Voice synthesis may be restricted on public cloud deployments due to third-party free-tier API limitations. Full functionality is demonstrated in the video demo.


πŸ— Architecture Overview

Architecture Diagram


πŸ›  Tech Stack

Frontend

Streamlit

Retrieval Layer

SentenceTransformers (all-MiniLM-L6-v2)

Scikit-learn (Cosine Similarity)

NumPy

LLM Providers

Groq API (LLaMA / Mixtral)

OpenAI API (GPT models)

Google Gemini API

Voice (Optional)

ElevenLabs API (local usage)

Deployment

Streamlit Community Cloud

🧩 System Design Decisions

Why Hybrid Retrieval?

Pure semantic similarity may miss command-based or procedural queries (e.g., pip install transformers).

To improve retrieval precision, the system combines:

Semantic similarity (embedding-based search)

Keyword boosting (for command-heavy technical queries)

This ensures technical instructions and CLI commands are prioritized correctly.

Why Multi-LLM Support?

The application abstracts model providers to:

Avoid provider lock-in

Compare response quality across models

Handle rate limits gracefully

Demonstrate modular LLM architecture

The provider can be switched dynamically at runtime.

Why a Separate Voice Summary Layer?

Instead of reading the full technical response:

A second LLM prompt generates a concise conversational summary

Commands are referenced rather than read verbatim

The tone remains natural and support-oriented

This improves usability and creates a more human-like interaction model.

Why Session-Based Memory?

The system maintains recent conversation history using Streamlit session state.

This:

Preserves conversational coherence

Enables contextual follow-up questions

Avoids requiring an external vector database

πŸ’» Installation (Local Development)

1️⃣ Clone Repository

git clone https://github.com/your-username/HuggingFace_voice_customer_support_agent.git
cd HuggingFace_voice_customer_support_agent

2️⃣ Create Virtual Environment

python -m venv venv

macOS / Linux

source venv/bin/activate

Windows

venv\Scripts\activate

3️⃣ Install Dependencies

pip install -r requirements.txt

4️⃣ Add Environment Variables

Create a .env file in the project root:

GROQ_API_KEY="your_key"
OPENAI_API_KEY="your_key"
GEMINI_API_KEY="your_key"
ELEVENLABS_API_KEY="your_key"

5️⃣ Run Application

streamlit run app.py

☁ Deployment (Streamlit Cloud)

Push repository to GitHub

Create a new app on Streamlit Community Cloud

Select the desired branch

Add API keys under Secrets

Deploy

Voice synthesis may be restricted on public cloud deployments due to third-party API limitations.

πŸ“ˆ Future Improvements

Replace local documentation file with automated web crawler ingestion

Integrate a persistent vector database (Qdrant / Pinecone)

Add authentication and usage tracking

Integrate browser-based speech recognition

Add retrieval precision evaluation metrics

πŸ“„ License

MIT License

About

Built a voice-enabled conversational RAG support agent with hybrid retrieval, multi-LLM orchestration, Whisper STT, and ElevenLabs TTS, improving grounded response accuracy (~40%) and reducing clarification loops (~50%).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages