An AI-powered conversational agent that helps users find and compare mobile phones based on their preferences.
- Natural language understanding for mobile phone queries
- Intent classification to understand user requests
- Mobile phone database with filtering capabilities
- Conversational interface for easy interaction
- RESTful API for integration with frontend applications
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
- Create a
.envfile based on.env.exampleand fill in your configuration - Run the application:
python app.py
- Python 3.8+
- Git
- Supabase
- Gemini API Key
-
Prepare your code
- Make sure all your changes are committed to a Git repository
- Push your code to GitHub, GitLab, or Bitbucket
-
Deploy to Render
- Sign up at Render if you haven't already
- Click "New" and select "Web Service"
- Connect your repository
- Configure the deployment:
- Name:
mobile-shopping-agent - Region: Choose the one closest to your users
- Branch:
mainor your preferred branch - Build Command:
pip install -r requirements.txt
- Name:
- Add environment variables from your
.envfile - Click "Create Web Service"
-
Set up custom domain (optional)
- Go to your service settings
- Click "Add Custom Domain" and follow the instructions
Create a .env file in the root directory with the following variables:
FLASK_ENV=production
SECRET_KEY=your-secret-key-here.
├── app.py # Main application file
├── requirements.txt # Python dependencies
├── .env.example # Example environment variables
├── models/ # ML models for intent classification
├── utils/ # Utility functions
├──────── agent.py # Chat agent implementation
├──────── data_loader.py # Data loading and querying
└── data/ # Sample mobile phone dataset
POST /api/chat
{
"message": "I'm looking for an iPhone under $1000"
}
{
"response": "Here are some iPhones under $1000...",
"suggestions": ["Show more", "Filter by storage", "Compare models"],
"products": [...]
}- Application not starting: Check the logs in your hosting provider's dashboard
- Database connection issues: Verify your
MONGODB_URIis correct and the database is accessible - Dependency issues: Make sure all dependencies are installed with the correct versions