This project demonstrates an AI-enhanced product search experience with reasoning capabilities. It consists of a Next.js frontend and a FastAPI backend.
The application showcases how AI can improve product search by:
- Providing transparent reasoning for search results
- Personalizing results based on user personas
- Comparing traditional and AI-enhanced search approaches
- Visualizing search confidence and ranking metrics
The Smart Shopping Assistant transforms online shopping by tailoring product recommendations to your unique preferences and shopping style. The platform adapts its search results and product rankings based on your selected shopping persona, ensuring you discover products that truly align with your priorities.
The application features four distinct shopping personas that represent different consumer priorities:
- Luxury Diva: Prioritizes premium brands and high-quality products
- Smart Saver: Focuses on value and finding the best deals
- Tech Maven: Favors innovation and the latest technologies
- Eco Warrior: Emphasizes sustainable and environmentally friendly options
This approach eliminates hours of product comparison by instantly identifying items that match specific user preferences.
The platform provides a conventional search experience where you can enter keywords (such as "headphones") to find relevant products. In standard mode, results are displayed based on traditional ranking factors without personalization.
When you enable AI Reasoning mode via the toggle switch, the system activates its advanced recommendation engine. This feature:
- Dynamically reranks products based on your selected persona's preferences
- Displays match percentage scores on each product card, indicating compatibility with the user profile
- Shows ranking changes through visual indicators, allowing you to see how products move up or down in relevance
Unlike typical "black box" recommendation systems, the application provides complete transparency into why certain products are recommended:
- Product cards can be flipped to reveal detailed reasoning behind each recommendation
- The system displays feature-by-feature analysis of how each product attribute was evaluated
- Quality, brand recognition, price sensitivity, and other factors are scored based on your persona's preference weights
This transparency ensures users understand exactly why certain products are recommended, giving them confidence in purchasing decisions while maintaining complete control over their shopping experience.
- Node.js 16+ for the frontend
- Python 3.8+ for the backend
- Conda for environment management
# Install dependencies
npm install# Create and activate conda environment
conda create -n recommendation-reasoning python=3.9
conda activate recommendation-reasoning
# Install backend dependencies
cd backend
pip install -r requirements.txt# From the project root
npm run devThe frontend will be available at http://localhost:3000.
# From the backend directory
cd backend
uvicorn main:app --reloadThe API will be available at http://localhost:8000.
We've provided a convenience script to run both services at once:
# Make the script executable
chmod +x run.sh
# Run both services
./run.shWhen the backend is running, API documentation is available at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
frontend/: Next.js frontend applicationbackend/: FastAPI backend applicationservices/: Core service implementationsmodels/: Data models and schemasconfig/: Configuration settingsutils/: Utility functionsdata/: Static data files