Zain-ul-din/whatsapp-agents
À propos
This is a WhatsApp AI bot that uses various AI models, including Deepseek, GPT, DALL-E, Gemini and StabilityAI, to generate responses to user input.
IA et apprentissage automatiqueWhat you can do
- WhatsApp connection via Baileys, with QR login and persistent sessions
- Messages are batched per conversation and answered with prior context
- OpenAI models through a ChatGPT subscription
- Web search tool powered by Exa
Progression mesurée des étoiles
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- +2
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
Original
WhatsApp Agents 🚀
WhatsApp Agents connects an AI agent to WhatsApp. Incoming messages are queued per conversation and answered by an agent that can use tools such as web search. The agent's behaviour is set by an editable instructions file, not by code.
Table of Content
Features
- WhatsApp connection via Baileys, with QR login and persistent sessions
- Messages are batched per conversation and answered with prior context
- OpenAI models through a ChatGPT subscription
- Web search tool powered by Exa
- Agent instructions loaded from
agents/instructions.md - PII guard: personal data is swapped for placeholders before reaching the model (see Privacy)
Privacy
The model never sees customers' personal data.
in: "call me on 0300 1234567" → model sees "call me on [PHONE_1]"
out: "we'll call [PHONE_1]" → customer sees "we'll call 0300 1234567"
- Detection runs in two layers. Pattern matching with checksum validation catches phone numbers (international), emails, CNICs, cards, IBANs, passwords and OTPs. An optional GLiNER service adds multilingual detection of names, addresses and IDs.
- Per-chat vault. Each chat has its own placeholder map. Placeholders can only be restored in the chat that created them. Values are encrypted at rest (AES-256-GCM) and looked up by keyed hash.
- Tool guard. Web search refuses queries that contain personal data or placeholders.
- Fail-safe. If the detection service is down, pattern matching still runs.
Demo
Gemini
Stability AI + Chat-GPT

Dalle + Custom Model

Usage
1. Get the code
git clone https://github.com/Zain-ul-din/WhatsApp-Ai-bot.git
cd WhatsApp-Ai-bot
pnpm install
2. Configure
Copy .env.example to .env and fill in the credentials. Then write your agent's instructions in agents/instructions.md. If the file is missing, a generic default is used.
3. Run
pnpm start
Or run the bot together with the PII detection service: docker compose up -d --build (see Deployment).
Scan the QR code with WhatsApp (Linked devices → Link a device).
Disclaimer
This bot utilizes baileys to operate an actual instance of Whatsapp Web to prevent blocking. However, it is essential to note that model and tool providers may charge for every request made. Please be aware that WhatsApp does not support bots or unofficial clients on its platform, so using this method is not entirely secure and could lead to getting blocked.
Contributors
Sponsors
A big thank you to these people for supporting this project.
Levitco |
Anas Ashfaq |
YOU? |
Useful links
| ♥ Sponsor | 💎 Bounty | 🚀 Deployment | ✉ WhatsApp Group |
|---|---|---|---|
| Link | Link | Link | Link |
About Us
This repository is maintained by Zain-Ul-Din
Show some ❤️ by starring this awesome repository!
Explorer des projets similaires
Chargement…
