whatsapp-chatgpt-bot
A ready-to-run open-source (MIT) Node.js bot that turns a WhatsApp number into a
multimodal AI assistant. Maintained by wassenger (wassengerhq), the WhatsApp API
platform it plugs into; ~167★ / 64 forks. It is a channel-deployed conversational agent —
the “wrap a model in a harness and point it at a messaging channel” pattern, shipped as a
business-support demo rather than a coding harness.
What it is
Incoming WhatsApp messages arrive at a webhook (via the Wassenger API), get routed to an
OpenAI model (GPT-4o), and the reply is sent back over WhatsApp. It keeps a
per-conversation history for context, and the whole persona is set by a natural-language
system prompt in config.js — the “agent = a configured instruction layer over a model”
shape, applied to customer support.
Architecture / stack
- Runtime: Node.js (v16+), plain JavaScript.
- Components:
bot.js(chat logic),server.js(webhook handler),config.js(persona + limits),functions.js(RAG tool-function definitions),store.js(persistence). - Integrations: Wassenger API (WhatsApp connectivity), OpenAI API (the model), Ngrok (dev tunnelling + auto webhook registration).
- Deploy targets: Heroku, Render, Railway, Fly.io via env-var config.
Notable features
- Multimodal I/O — accepts text, images, and audio; can reply with synthesized speech.
- RAG via tool/function-calling —
functions.jsdeclares functions the model can call to pull data from external APIs/databases at answer time (retrieval as tool use, not a vector store). Compare the retrieval-heavy knowledge-rag and the ReAct/RAG recipes in cult-ui-agent-patterns. - MCP integration — supports MCP for extended tools/context. Notable because this is an OpenAI-based, non-Anthropic bot reaching for MCP — a data point on MCP spreading past the Claude ecosystem into third-party messaging bots.
- Cost/abuse controls — token limits, rate limiting, audio-duration and image-size caps, number/label blacklist–whitelist filtering.
- Human handoff — simple commands hand a conversation off to a human agent (the autonomy-boundary instinct, in a support context).
Where it sits
Against this spoke’s Claude-Code / coding-harness–heavy corpus, this is the messaging-channel gateway corner: the same harness anatomy (model + persona + tools + memory + limits) wired to a consumer channel instead of a terminal. It rhymes with the “chat-app message gateway” in deer-flow and the gateway-first breadth of openclaw, but as a single-channel, single-purpose business product. The channel it rides on — the WhatsApp Business Platform and its API/BSP mechanics — is documented cross-wiki in whatsapp-business-platform (business-messaging-wiki).
Tier
T3 — first-party primary artifact (the repo is what it documents), but a vendor-promotional demo whose purpose is to sell the Wassenger WhatsApp API; modest traction (167★). Reliable about its own design; not an independent or load-bearing claim.