AI Shopping Assistant

A conversational AI shopping assistant for web-based product discovery and decision-making.


๐Ÿ›๏ธ AI Shopping Assistant

An intelligent, conversational shopping assistant powered by the Groq AI model and Model Context Protocol (MCP) for smart web-based product discovery and decision-making.


โœจ Overview

The AI Shopping Assistant is an interactive, AI-powered chatbot that helps users make smarter shopping decisions. Backed by xAIโ€™s Groq LLM and the Model Context Protocol (MCP), it can:

  • ๐Ÿง  Understand natural language queries
  • ๐Ÿ”Ž Conduct real-time searches on shopping platforms
  • ๐Ÿ›’ Compare products, services, and features
  • ๐Ÿ’ธ Provide price guidance and recommendations

Whether you're choosing between phones, comparing streaming services, or searching for the best air purifier under a budgetโ€”this assistant is your ultimate shopping buddy.


๐Ÿงฉ Features

FeatureDescription
๐Ÿ”„ Product ComparisonCompare products (e.g., iPhone 15 vs. Galaxy S24)
๐ŸŽฏ Smart RecommendationsGet suggestions based on your needs and budget
๐Ÿ“Š Feature AnalysisUnderstand specs, pros, cons, and more
๐Ÿ’ต Price GuidanceDetermine best value options
๐ŸŒ Service ComparisonCompare services like Netflix vs. Prime Video
๐Ÿ” Web Search (via MCP)Searches shopping platforms like Amazon, Flipkart, Best Buy
๐Ÿ’ฌ Context-Aware ChatMaintains conversation context and provides summaries
๐Ÿ” Retries & FallbacksSmart handling of failed searches with category advice
๐Ÿ’ก Chat Commands/exit, /clear, /context, /status supported

๐Ÿš€ Installation

1. Clone the Repository

git clone <repository-url>
cd ai-shopping-assistant

2. Set Up a Virtual Environment (Optional)

python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

3. Install Python Dependencies

pip install -r requirements.txt

4. Install MCP Node.js Dependencies

Make sure Node.js and npm are installed:

npm install -g @playwright/mcp @openbnb/mcp-server-airbnb duckduckgo-mcp-server

5. Environment Setup

Create a .env file in the root directory:

echo "GROQ_API_KEY=your-api-key-here" > .env

6. MCP Configuration

Ensure you have a valid browser_mcp.json in your MCP directory (e.g., D:\mcp\mcpdemo\):

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest"]
    },
    "airbnb": {
      "command": "npx",
      "args": ["-y", "@openbnb/mcp-server-airbnb"]
    },
    "duckduckgo-search": {
      "command": "npx",
      "args": ["-y", "duckduckgo-mcp-server"]
    }
  }
}

In shopping_assistant.py, set:

self.config_file = r"path/to/your/browser_mcp.json"

๐Ÿง  Usage

Start the Assistant:

python shopping_assistant.py

Example Queries:

๐Ÿ›’ You: Best laptop for programming under $1000  
๐Ÿค– Assistant: ๐Ÿ” Searching... (attempt 1/3)  
โœ… Successfully retrieved current information  
[Laptop recommendations with specs and prices]

Commands You Can Use:

  • exit or quit โ€“ End the session
  • clear โ€“ Reset chat history
  • context โ€“ View recent conversation summary
  • status โ€“ Check last search time and rate limits

๐Ÿ—‚๏ธ Project Structure

ai-shopping-assistant/
โ”œโ”€โ”€ shopping_assistant.py      # Main assistant logic
โ”œโ”€โ”€ requirements.txt           # Python dependencies
โ”œโ”€โ”€ .env                       # Environment variables
โ”œโ”€โ”€ browser_mcp.json           # MCP config for search engines
โ””โ”€โ”€ README.md                  # You're reading it!

๐Ÿ“ฆ Requirements

Add the following to your requirements.txt:

langchain-grok==0.1.0
python-dotenv==1.0.0
requests==2.31.0
mcp-use==<latest-version>

โš™๏ธ Configuration Details

SettingDescription
๐Ÿ”‘ GROQ_API_KEYSet in .env for xAIโ€™s Grok access
๐Ÿ•’ Rate Limiting3-second delay between API searches
๐Ÿ” RetriesUp to 3 search retries with 5s backoff
๐Ÿ“ MCP FileJSON config for search integration
๐Ÿ“ฆ ModelDefault: qwen-qwq-32b (Grok model)
๐Ÿ›๏ธ CategoriesElectronics, appliances, services, clothing, home

โš ๏ธ Limitations

  • Requires internet connection for API and MCP search
  • Prices may varyโ€”verify with retailers
  • Only predefined categories supported
  • MCP setup requires proper Node.js configuration
  • Offline fallbacks may offer limited depth

๐Ÿ”ฎ Future Enhancements

  • ๐Ÿ›’ Real-time price scraping from major e-retailers
  • ๐Ÿงฌ Personalized recommendations via user profiles
  • ๐Ÿ–ฅ๏ธ Web-based UI for a seamless UX
  • ๐Ÿ› ๏ธ Enhanced MCP integration with more shopping portals

๐Ÿค Contributing

Contributions are welcome! To contribute:

  1. Fork the repository

  2. Create your feature branch

    git checkout -b feature/your-feature
    
  3. Commit your changes

    git commit -m "Add your feature"
    
  4. Push and open a PR

    git push origin feature/your-feature
    

Images:

1: app1 2: app2 3: app3 4: shop1 5: shop2 6: shop3

๐Ÿง  AI + Shopping = Smarter Choices Start your intelligent shopping journey now with the AI Shopping Assistant.

Related Servers