Skip to content
프로젝트

소개

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.

AI 및 머신러닝

이 수치를 측정하는 방법

What 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

측정된 스타 증가

in 24h
0
in 7 days
+1
in 15 days
+2
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

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

Screenshot (1186)

Stability AI + Chat-GPT

image

Dalle + Custom Model

image


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
Levitco
Anas Ashfaq
Anas Ashfaq
You
YOU?

Useful links

♥ Sponsor 💎 Bounty 🚀 Deployment ✉ WhatsApp Group
Link Link Link Link
Featured on Aura++

About Us

This repository is maintained by Zain-Ul-Din

Show some ❤️ by starring this awesome repository!

Buy Me A Coffee

관련 프로젝트 살펴보기

불러오는 중…