Skip to content

JohnJyong/haggle_ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Haggle AI 🤖💸

Your Automated Negotiation Agent / 你的自动化谈判专家

"Don't just pay full price. Let AI haggle for you." "拒绝做大冤种,让 AI 帮你争取权益。"

📖 Introduction

Haggle AI is a Proof-of-Concept (MVP) agent designed to help users negotiate with customer service bots and representatives. It uses "Maximizer Strategy" to draft high-context, policy-aware responses for refunds, cancellations, and discounts.

Currently supports two modes:

  1. Chrome Extension: For live chat interfaces (e.g., e-commerce support).
  2. Email Bot (Python): For asynchronous email disputes (e.g., refunds, contract cancellations).

🚀 Features

  • The "Maximizer" Mode: Automatically cites consumer protection laws and logic to maximize refund chances.
  • Context Awareness: Reads the last message from support agents to generate relevant counter-arguments.
  • Safety First:
    • Extension: Auto-fills the input box but lets you review before sending.
    • Email: Creates Drafts only; never sends automatically.

🛠️ Usage 1: Chrome Extension (Browser)

Installation

  1. Clone this repo: git clone https://github.com/JohnJyong/haggle_ai.git
  2. Open Chrome and go to chrome://extensions/.
  3. Enable Developer mode (top right).
  4. Click Load unpacked.
  5. Select the haggle_ai folder (where manifest.json is located).

How to Use

  1. Open a customer support chat window (e.g., Taobao, JD, Amazon).
  2. Click the Haggle Icon in your browser toolbar.
  3. Click "😤 帮我怼回去" (Fight Back).
  4. The agent will read the chat (or prompt you for context) and fill the input box with a strong reply.

📧 Usage 2: Email Bot (Python)

Setup

  1. Ensure you have Python 3 installed.
  2. (Optional) This script uses a Mock Gmail API for demonstration. In a real scenario, you would need google-api-python-client.

Running the Demo

python3 email_bot.py

What it does

  1. Scans your (mock) inbox for emails labeled Haggle.
  2. Analyzes the rejection reason (e.g., "Outside return window", "Cancellation fee").
  3. Generates a counter-argument.
  4. Creates a Draft reply for you to review.

⚠️ Disclaimer

This is a prototype for educational and demonstration purposes.

  • The "AI" logic in this MVP is rule-based (mocked). Real-world deployment would require connecting to an LLM API (e.g., OpenAI, Gemini, DeepSeek).
  • Use responsibly. Be polite even when negotiating!

📜 License

MIT

About

"Haggle" (讨价还价) - 你的自动化客服博弈 Agent

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors