An intelligent chatbot system for banking customer support, built with Streamlit, OpenAI Whisper, Sentence Transformers, and the Gemini LLM.
The system enhances customer interactions by providing accurate, contextually relevant responses through both text and audio outputs.
- Speech Recognition – transcribe user audio inputs with OpenAI Whisper
- Intent Classification – classify queries using sentence embeddings + cosine similarity
- Contextual Response Generation – generate informed replies with Gemini LLM and chat history memory
- Text-to-Speech Output – convert chatbot responses into natural audio via gTTS
- Clone the repository
git clone https://github.com/your-username/BankSupportAI.git
cd BankSupportAI- Create a virtual environment (recommended)
python -m venv env
source env/bin/activate # On Windows: env\Scripts\activate- Install dependencies
pip install -r requirements.txt- Set up API key
Add your OpenAI API key to a
.envfile:
OPENAI_API_KEY="your_openai_api_key"- Run the application
streamlit run app.py- Interact with the chatbot
- Type your question or message in the input field
- Optionally, click the microphone icon to record an audio query
app.py– main app logic, Streamlit UI, chatbot coordinationchatbot.py– defines theChatBotclass with LLMChain and intent classificationaudio_utils.py– handles transcription (Whisper), text-to-speech (gTTS), and audio playbackintent.csv/intent_embeddings.csv– predefined intents and embeddings dataset
- Uses sentence transformer embeddings for both queries and intents
- Cosine similarity selects the most relevant intent
ChatBotintegrates withLLMChainand a custom prompt template- Responses are context-aware, leveraging chat history + intent classification
- Transcription: OpenAI Whisper converts audio → text
- Text-to-Speech: gTTS generates WAV responses, played in Streamlit