An intelligent conversational sales agent deployed over WhatsApp — built for e-commerce businesses to automate customer interactions, product discovery, and purchase intent qualification.
Add a screenshot or screen recording of a WhatsApp conversation here
- 💬 Conversational product discovery — customers describe what they want in plain language, the agent recommends products
- 🧠 LLM-powered responses — context-aware replies using LangChain + OpenAI API
- 🛒 Purchase intent qualification — identifies buying signals and escalates to human agents when needed
- 🔁 Objection handling — responds to common hesitations (price, delivery, returns) automatically
- 📲 WhatsApp Business API integration — works natively inside WhatsApp, no app install required for the customer
- 🔌 Webhook-based architecture — stateless, scalable, and easy to deploy
| Layer | Technology |
|---|---|
| AI / LLM | LangChain · OpenAI API |
| Messaging | WhatsApp Business API (Meta Cloud API) |
| Backend | FAST API / Python |
| Deployment | Docker |
- Node.js 18+ or Python 3.10+
- Meta Developer account with WhatsApp Business API access
- OpenAI API key
git clone https://github.com/sam3690/WA_Agent.git
cd WA_Agent
npm install # or: pip install -r requirements.txtCreate a .env file in the root directory:
OPENAI_API_KEY=your_openai_api_key
WHATSAPP_TOKEN=your_whatsapp_business_token
WHATSAPP_PHONE_NUMBER_ID=your_phone_number_id
VERIFY_TOKEN=your_webhook_verify_tokennpm run dev # or: python main.pyFor local webhook testing, use ngrok:
ngrok http 3000Point your Meta webhook URL to the ngrok HTTPS URL.
Customer (WhatsApp)
│
▼
WhatsApp Business API (Meta)
│ webhook
▼
Backend Server (Node.js / Python)
│
├──▶ LangChain Agent
│ │
│ ├──▶ OpenAI API (LLM reasoning)
│ └──▶ Tool calls (product lookup, FAQ, escalation)
│
└──▶ WhatsApp API (send reply)
WA_Agent/
├── src/
│ ├── agent/ # LangChain agent setup & tools
│ ├── webhook/ # WhatsApp webhook handler
│ ├── services/ # OpenAI, WhatsApp API clients
│ └── utils/ # Helpers, message formatting
├── .env.example
├── package.json
└── README.md
- E-commerce stores with high inbound WhatsApp volume
- Businesses replacing manual first-response sales with automation
- Any product catalog that benefits from natural language search
Usama Ayoub — Backend Developer & AI Automation Engineer
LinkedIn · Portfolio · usamabinayoub@gmail.com
MIT License — feel free to use, fork, and build on this.