A WhatsApp bot that can participate in group conversations, powered by AI. The bot monitors group messages and responds when mentioned.
- Automated group chat responses when mentioned
- Message history tracking and summarization
- Knowledge base integration for informed responses
- Support for various message types (text, media, links, etc.)
- Group management capabilities
- Docker and Docker Compose
- Python 3.12+
- PostgreSQL with pgvector extension
- Voyage AI API key
- WhatsApp account for the bot
-
Clone the repository
-
Create a
.env
file in the src directory with the following variables:
WHATSAPP_HOST=http://localhost:3000
WHATSAPP_BASIC_AUTH_USER=admin
WHATSAPP_BASIC_AUTH_PASSWORD=admin
VOYAGE_API_KEY=your_voyage_api_key
DB_URI=postgresql+asyncpg://user:password@localhost:5432/webhook_db
LOG_LEVEL=INFO
- Start the services:
docker-compose up -d
- Initialize the WhatsApp connection by scanning the QR code through the WhatsApp web interface.
The project consists of several key components:
- FastAPI backend for webhook handling
- WhatsApp Web API client for message interaction
- PostgreSQL database with vector storage for knowledge base
- AI-powered message processing and response generation
- Main application:
app/main.py
- WhatsApp client:
src/whatsapp/client.py
- Message handler:
src/handler/__init__.py
- Database models:
src/models/
- Fork the repository
- Create a feature branch
- Submit a pull request
[Add your license here]