Skip to content

Latest commit

 

History

History
100 lines (75 loc) · 2.85 KB

File metadata and controls

100 lines (75 loc) · 2.85 KB

PartSelect Agent

An AI chat assistant for PartSelect.com that helps users find, diagnose, and install parts for refrigerators and dishwashers.

Features

  • Diagnose appliance symptoms and get recommended parts
  • Search for parts by name, symptom, or part number
  • Check part compatibility with your appliance model number
  • Get installation guides and repair difficulty estimates
  • Streaming responses with inline part cards (image, price, compatibility badge)

Tech Stack

  • Frontend: React (Create React App)
  • Backend: FastAPI (Python), port 8000
  • LLM: OpenRouter API (google/gemini-2.5-flash) with tool-calling
  • Data: 38 real PartSelect parts in JSON + ChromaDB vector store
  • Embeddings: sentence-transformers/all-MiniLM-L6-v2

Prerequisites

Setup

1. Clone the repo

git clone https://github.com/nb183/partselect-agent.git
cd partselect-agent

2. Backend

cd backend

# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate      # Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Add your API key
echo "OPENROUTER_API_KEY=your_key_here" > .env

# Build the vector store (run once)
python vectorstore/setup.py

# Start the backend
uvicorn main:app --reload --port 8000

3. Frontend

In a separate terminal:

cd frontend
npm install
npm start

Open http://localhost:3000.

Project Structure

partselect-agent/
├── frontend/                     # React frontend
│   ├── src/
│   │   ├── api/api.js            # Streaming fetch to backend
│   │   └── components/
│   │       ├── ChatWindow.js     # Main chat interface
│   │       ├── PartCard.js       # Part result card
│   │       └── SuggestedPrompts.js
│   └── public/
├── backend/
│   ├── main.py                   # FastAPI app
│   ├── agent.py                  # LLM orchestrator + tool schemas
│   ├── tools/                    # 5 tool implementations
│   ├── data/
│   │   ├── parts.json            # 38 scraped PartSelect parts
│   │   └── scraper.py            # PartSelect scraper (reference)
│   └── vectorstore/
│       ├── setup.py              # Embed parts into ChromaDB (run once)
│       └── query.py              # Semantic search helpers

Usage

  • Type a symptom: "My refrigerator is not cooling"
  • Ask for a part: "Find a door latch for my GE dishwasher"
  • Check compatibility: "Is part W10782469 compatible with model WDT730PAHZ?"
  • Get install help: "How do I install part WR30X10093?"
  • Provide your model number and it will be remembered for the session