PartSelect Chat Agent is an intelligent conversational system designed to assist users with appliance parts selection and repair guidance. The agent combines advanced RAG (Retrieval-Augmented Generation) technology with SQL database integration to provide accurate, context-aware responses for appliance maintenance and repair queries.
- 🔍 Smart parts identification and pricing information
- 🛠️ Step-by-step repair guidance
- 📚 Access to comprehensive repair documentation and blog posts
- 🤖 Context-aware conversation handling
- 💡 Intelligent retrieval system combining RAG and SQL for accurate responses
This flowchart shows the system's architecture including:
- Database structure (Parts, Blog, Repair tables)
- Retrieval process using RAG + SQL
- Chat loop flow with query processing and response generation
- Python 3.11 or higher
- Conda or pip package manager
- Git
- Clone the repository:
git clone https://github.com/zehuiwu/partselect-agent.git
cd priceselect-agent- Create and activate a new conda environment:
conda create -n new_env python=3.11
conda activate new_env- Install the required packages:
pip install -r requirements.txtCreate a .env file in the root directory with the following variables:
OPENAI_API_KEY=your_openai_api_key
DEEPSEEK_API_KEY=your_deepseek_api_key
Replace your_*_api_key with your actual API keys.
Note: Make sure to keep your .env file private and never commit it to version control.
-
Install MySQL:
- For macOS:
brew install mysql - For Ubuntu:
sudo apt-get install mysql-server - For Windows: Download and install MySQL from the official website
- For macOS:
-
Start MySQL service:
- For macOS:
brew services start mysql - For Ubuntu:
sudo service mysql start - For Windows: MySQL service should start automatically
- For macOS:
-
Import the data:
# Create the database mysql -u root -p -e "CREATE DATABASE partselect;" # Import the CSV files mysql -u root -p partselect < data/all_parts.csv mysql -u root -p partselect < data/all_repairs.csv
-
Add the following environment variables to your
.envfile:MYSQL_HOST=localhost MYSQL_PORT=3306 MYSQL_USER=root MYSQL_PASSWORD=your_password MYSQL_DATABASE=partselectReplace
your_passwordwith your MySQL root password.
Note: Make sure the MySQL server is running before starting the PriceSelect Chat Agent.
To start the web interface:
-
Navigate to the web client directory:
cd lily_client/web -
Start the server with hot reloading enabled:
hypercorn app:app --reload
-
Open your web browser and navigate to
http://localhost:8000to access the web interface.


