β οΈ Important Notice: This project is not intended for production use.
It uses Plan & Execute Agent Architecture. Specifically chosen for handling complex task like finding coupons without losing the context.
- 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.
The backend uses:
- β‘ FastAPI
- π LangChain
- π€ OpenAI's GPT models
- ποΈ EasyOCR
- π BeautifulSoup4
The Chrome extension uses:
- π» JavaScript (no framework)
- π Webextension-Polyfill for All Browsers
-
π 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
-
π 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
- When you're on a cart or checkout page, the extension will:
-
π³ 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
- Clone the repository:
git clone https://github.com/erenkucuker/discount_finder_langchain.git
cd discount_finder_langchain/api
- Install dependencies:
poetry install
- Create a
.env
file in theapi
directory:
OPENAI_API_KEY=your_openai_api_key_here
- Start the API server:
cd api
poetry run dev
- Load the extension in Chrome:
- Open Chrome and go to
chrome://extensions/
- Enable "Developer mode"
- Click "Load unpacked"
- Select the
extension
directory
- Open Chrome and go to
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
This project is licensed under the MIT License - see the LICENSE file for details.