Welcome to the Granite-chan project, an advanced retrieval-augmented generation (RAG) system designed to help customers navigate Granite Supercenter with both an online AI chatbot and an offline physical robot.
Granite-chan offers personalized shopping assistance using a tsundere personality, integrated with IBM WatsonX for natural language understanding and Piper TTS for voice generation.
This repository contains:
- The AI chatbot for online use.
- The offline robot assistant for guiding customers in the physical store.
- Demo video showcasing the capabilities.
The project is organized as follows:
/Granite-chan
/data # Contains the PDF files with supercenter details
/piper # Contains the Piper TTS model and config files
requirements.txt # Python dependencies required for the project
advanceRAG_api.py # The core API logic for response generation using RAG
main.py # Main file to run the application and test Granite-chan
demo_video.mp4 # Demo video showcasing the robot and AI chatbot in action
Before running the project, you need to install the required Python dependencies. This is crucial to ensure that all libraries and frameworks work smoothly.
-
Create a Virtual Environment (optional but recommended):
conda create --name granite-chan python=3.11 -y conda activate granite-chan
-
Install Required Libraries using the
requirements.txtfile:pip install -r requirements.txt
This will install all necessary packages for running Granite-chan:
langchainFAISSibm-watsonx-aiPiper TTSRealtimeSTT- Other dependencies for document loading and model inference
Make sure the project directory is structured like this:
/Granite-chan
/data # Your PDFs with store information (Granite Supercenter Guide)
/piper # Contains Piper TTS model files and configuration
advanceRAG_api.py # The main logic for response generation
main.py # Main script to run
demo_video.mp4 # Demo video
Ensure that the following paths are correctly set in your main.py and advanceRAG_api.py:
-
Piper model files and configuration:
piper/en_GB-southern_english_female-low.onnxpiper/en_GB-southern_english_female-low.onnx.json
-
PDF Files:
- Store your Granite Supercenter Detailed Guide PDF in the
/datafolder.
- Store your Granite Supercenter Detailed Guide PDF in the
Because of the Piper TTS engine and its access to system resources, it’s recommended to run the application as Administrator to avoid permission issues.
-
Open VS Code as Administrator:
- Right-click on VS Code and select Run as Administrator.
-
Run the
main.pyfile:- Make sure you're in the project directory and run:
python main.py
The application will:
- Start listening to speech input.
- Process the speech-to-text output.
- Generate Granite-chan's response and speak it aloud via Piper TTS.
- The destination (store zone) will also be displayed in the terminal.
-
Granite-chan acts as a tsundere assistant for online shopping. Users can interact with the chatbot to ask questions about store sections, products, promotions, etc.
-
Granite-chan responds with a playful and sarcastic tone, guiding users through the store’s available sections and promotions.
Example:
User: Where can I buy a new bed? Granite-chan: Ugh, you want to buy a bed? Fine, I’ll take you to the furniture section... but don’t think I care, okay? Destination: furniture
- Granite-chan’s physical robot uses Piper TTS to give directions and guide customers in the supercenter.
- The robot helps guide customers to different zones (like Furniture, Food, Restrooms, etc.) while maintaining her tsundere personality.
- The system uses Retrieval-Augmented Generation (RAG) to provide contextual answers by retrieving relevant data from the supercenter documents (PDF/TXT).
- The Granite Assistant dynamically answers based on available context and customer queries.
Example:
User: What are the promotions in the clothing section?
Granite-chan: Oh, you want the promotions? Fine! Buy 1, Get 1 Free on T-shirts for Men and Women, and 50% Off the Summer Collection. Happy now?
Destination: clothing
To view the demo video, simply open the file:
/demo_video.mp4
deme_vdo-2.mp4
This video showcases:
- Granite-chan’s interaction in both the online chatbot and offline robot versions.
- Granite-chan’s tsundere personality as she guides the user around the Granite Supercenter.
This project is licensed under the MIT License. See the LICENSE file for more details.
-
Error: "PermissionError: [WinError 5] Access is denied":
- Make sure you run VS Code as Administrator or ensure Piper’s
.exefile has appropriate permissions.
- Make sure you run VS Code as Administrator or ensure Piper’s
-
Error with
Piper TTS:- Ensure that the correct Piper TTS model is specified in the
main.pyfile. - Verify the path for the
piper.exeis correct and accessible.
- Ensure that the correct Piper TTS model is specified in the
We welcome contributions! If you have any suggestions or fixes, feel free to submit a pull request. Please follow the contribution guidelines in the repository.
For any questions, feel free to contact us via our github or create an issue in the repository.
- Granite-chan is designed to improve the shopping experience, whether online or in the supercenter.
- Piper TTS brings a fun and engaging personality to the assistant, adding a unique tsundere charm.
- The Advanced RAG allows the assistant to intelligently respond based on the supercenter’s data, while the physical robot can guide customers in real time!