AI-powered Indian bargaining & negotiation automation system
Vyapaar-AI is a production-ready negotiation automation engine built specifically for Indian retail & e-commerce context. It handles Hinglish bargaining conversations via Telegram, runs multi-turn price negotiation logic, and integrates directly with n8n workflows.
vyapaar-ai/
├── n8n-workflows/
│ └── tg-negotiator.json # Import this into n8n directly
├── src/
│ ├── controllers/
│ │ └── negotiator.js # Core bargaining algorithm
│ └── index.js # Express webhook server
├── .gitignore
├── package.json
└── README.md
git clone https://github.com/mehul82099/vyapaar-ai.git
cd vyapaar-ai
npm installnpm start
# Server runs on http://localhost:3000npm test
# Output: { status: 'NEGOTIATING', counterOffer: 1380, reply: '...', nextTurn: 2 }POST http://localhost:3000/negotiate
Content-Type: application/json
{
"chatId": "123456789",
"message": "800 mein de do bhaiya",
"mrp": 1500,
"minPrice": 1100
}
- Open your n8n instance
- Click Import → select
n8n-workflows/tg-negotiator.json - Add your Telegram Bot credentials
- Change
MRPandMIN_PRICEin the Code node - Activate workflow
[Telegram Trigger] --> [Negotiator Logic] --> [Send Reply]
| Scenario | Turn | Result |
|---|---|---|
| Offer >= MRP | Any | SOLD instantly |
| Offer >= minPrice | Turn 2+ | SOLD |
| Offer < minPrice | Turn 1-2 | Counter-offer sent |
| Offer < minPrice | Turn 3+ | WALKAWAY message |
| No price in message | Any | Intent classified |
- Node.js - Core negotiation engine
- Express.js - Webhook server
- n8n - Workflow automation
- Telegram Bot API - Customer interface
MIT © mehul82099