Caution
This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp or any of its subsidiaries or its affiliates. The official WhatsApp website can be found at whatsapp.com.
"WhatsApp" as well as related names, marks, emblems and images are registered trademarks of their respective owners.
The use of this project is at your own risk. The developers assume no responsibility for any consequences that may arise from using this application, including but not limited to account suspension or banning by WhatsApp. It is the user's personal responsibility to use this application in compliance with WhatsApp's Terms of Service. We strongly discourage spam, bulk messaging, or any use that could be considered harassment.
Important
This project is currently in its active development phase. The core architecture is stable, but features are being added and refined. Feel free to fork, experiment, and contribute!
The primary goal of QuBot WA is to break the mold of traditional, spammy WhatsApp bots. It operates on a "ghost participant" principle:
- Silent by Default: It listens to conversations without interrupting.
- Context-Aware: It understands the flow of conversation and decides to engage only when it's appropriate and valuable.
- Human-like Interaction: It uses dynamically calculated typing delays and a distinct personality defined by external prompt files.
- Action-Oriented: It's not just a chatbot. It's an agent capable of performing tasks like setting reminders, searching the web, and more.
- Fully Customizable: You can customize the bot's personality as you wish using the
persona.promptfile.
- LLM as a Router: Instead of rigid
if/elselogic, it uses an LLM (powered by Google Gemini or Groq) to analyze every message and decide whether to reply, what to say, and what action to take. - Dynamic Personality: The bot's core logic and personality are loaded from external
*.promptfiles, allowing for easy customization without touching the source code. - Modular Architecture:
- Actions (
/src/actions): A plug-and-play system for adding new capabilities. - REPL (
/src/repl): A powerful command-line interface to manage the bot directly from the terminal.
- Actions (
- Human Simulation:
- Realistic Typing Animation: The "is typing..." delay is calculated based on the length of the generated response.
- Intelligent Silence: A sophisticated prompt teaches the agent when not to speak.
- Rich Terminal Logging: A custom logger provides detailed, color-coded insights into every message and the AI's decision-making process.
- Secure Configuration: All sensitive keys are managed through a
.envfile.
- Runtime: Node.js
(recommend v22) - WhatsApp API: @whiskeysockets/baileys
- LLM Engine: Google Gemini (
@google/generative-ai) / Mistral AI - Configuration:
dotenv - Database (Planned):
better-sqlite3for memory and tasks. - Job Queue (Planned): For scheduled tasks like reminders.
The project is evolving. Here are the next major milestones:
-
Phase 1: Memory Implementation
- Short-Term Memory: Implement a database (SQLite) to remember the last N messages for better contextual understanding.
- Long-Term Memory: Develop a system for the agent to learn facts about users and groups.
-
Phase 2: Expanding Action Capabilities
- Reminder System: Fully implement the
set_reminderaction. - Web Search: Add a
google_searchaction for real-time information.
- Reminder System: Fully implement the
-
Phase 3: Enhanced Group Dynamics
- Proactive Engagement: Allow the agent to initiate conversations based on triggers.
- Sentiment Analysis: Improve the agent's ability to detect the mood of the chat.
-
Clone the repository:
git clone https://github.com/wd006/qubot-wa.git cd qubot-wa -
Install dependencies:
npm install
-
Configure your environment:
- Create a
.envfile in the root directory. - Add your API keys and phone number:
GEMINI_KEY=PASTE_YOUR_GOOGLE_API_KEY_HERE MISTRAL_KEY=PASTE_YOUR_MISTRAL_API_KEY_HERE OWNER_NUMBER=[email protected]
- Create a
-
Customize the prompts:
- Create and edit
persona.promptto shape its personality and rules.
- Create and edit
-
Run the bot:
node index.js
-
Scan the QR code with your WhatsApp account, and you're ready to go.
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributions are greatly appreciated. Please fork the repository and create a pull request, or open an issue.
E-Mail: [email protected]
Project Link: https://github.com/wd006/qubot-wa
For questions, bug reports, or support, please open an issue on the GitHub repository.