Skip to content

Basic Shopping Assistant AI agent example with πŸ¦œπŸ”— LangChain

License

Notifications You must be signed in to change notification settings

erenkucuker/discount_finder_langchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›οΈ AI Shopping Assistant & Coupon Finder Agent

⚠️ Important Notice: This project is not intended for production use.

Extension Screenshot

πŸ“‹ Overview

It uses Plan & Execute Agent Architecture. Specifically chosen for handling complex task like finding coupons without losing the context.

llm-compiler

πŸ“ Criticism & Limitations

  • For production use case there would be many programmatic tools before using LLM solutions to decrease the cost of usage.
  • Instead of using and agent a chain would work better.

πŸ› οΈ Tech Stack

πŸ”§ Backend

The backend uses:

  • ⚑ FastAPI
  • πŸ”— LangChain
  • πŸ€– OpenAI's GPT models
  • πŸ‘οΈ EasyOCR
  • 🌐 BeautifulSoup4

🎯 Extension

The Chrome extension uses:

  • πŸ’» JavaScript (no framework)
  • πŸ”„ Webextension-Polyfill for All Browsers

πŸ“– Usage

🎯 Basic Usage

  1. πŸ”„ Automatic Detection

    • Visit any e-commerce website
    • The extension automatically detects shopping-related pages
    • Works on popular platforms like Amazon, eBay, Walmart, and many others
  2. πŸ” Finding Coupons

    • When you're on a cart or checkout page, the extension will:
      • Automatically search for available coupons
      • Show a notification if coupons are found
      • Display the number of available coupons
  3. πŸ’³ Applying Coupons

    • Click "Yes, try coupons" in the notification
    • The extension will:
      • Automatically locate the coupon input field
      • Test each coupon code sequentially
      • Stop when it finds a working coupon
      • Show results via toast notifications

πŸš€ Installation

πŸ”§ Backend API Setup

  1. Clone the repository:
git clone https://github.com/erenkucuker/discount_finder_langchain.git
cd discount_finder_langchain/api
  1. Install dependencies:
poetry install
  1. Create a .env file in the api directory:
OPENAI_API_KEY=your_openai_api_key_here
  1. Start the API server:
cd api
poetry run dev

🌐 Chrome Extension Setup

  1. Load the extension in Chrome:
    • Open Chrome and go to chrome://extensions/
    • Enable "Developer mode"
    • Click "Load unpacked"
    • Select the extension directory

πŸ“ Project Structure

discount_finder_langchain/
β”œβ”€β”€ api/                          # Backend API directory
β”‚   β”œβ”€β”€ discount_finder_langchain/
β”‚   β”‚   β”œβ”€β”€ agent.py             # AI agent implementation
β”‚   β”‚   β”œβ”€β”€ config.py            # Configuration settings
β”‚   β”‚   β”œβ”€β”€ prompts.py           # LLM prompts
β”‚   β”‚   β”œβ”€β”€ routes.py            # API endpoints
β”‚   β”‚   β”œβ”€β”€ schemas.py           # Data models
β”‚   β”‚   β”œβ”€β”€ services.py          # Business logic
β”‚   β”‚   └── tools.py             # Agent tools
β”‚   β”œβ”€β”€ pyproject.toml           # Python dependencies
β”œβ”€β”€ extension/                    # Browser extension
β”‚   β”œβ”€β”€ manifest.json            # Extension config
β”‚   β”œβ”€β”€ popup.html               # Extension popup
β”‚   β”œβ”€β”€ popup.js                 # Popup logic
β”‚   β”œβ”€β”€ content.js               # Page interaction
β”‚   └── background.js            # Background processes
└── README.md                    # Documentation

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Basic Shopping Assistant AI agent example with πŸ¦œπŸ”— LangChain

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published