Transform your WhatsApp group chats into organized, insightful summaries with the power of AI. This intelligent system uses a team of AI agents to monitor group conversations, identify key discussions, and automatically generate comprehensive daily summaries.
- ๐ Information Overload: Keep up with busy group chats without reading every message
- ๐ฏ Key Insights: Never miss important discussions or decisions
- โฐ Time Saving: Get daily summaries delivered automatically
- ๐ค Better Collaboration: Keep everyone informed with minimal effort
Built with CrewAI, this project demonstrates the power of multi-agent AI systems working together. The Message Handler manages WhatsApp communication while the Summarization Specialist analyzes content, creating a seamless automated summary pipeline.
- ๐ข Business Teams
- ๐ฅ Community Groups
- ๐ Study Groups
- ๐ Remote Teams
- ๐ Project Management
- ๐ค Networking Groups
- ๐ค Multi-agent AI system for intelligent message processing
- ๐ฑ WhatsApp Business API integration
- ๐ Daily group activity summaries
- โฐ Automated scheduling of summaries
- ๐ Smart message analysis and topic identification
- ๐ฏ Customizable summary formats and timing
- Python >=3.10 <=3.13
- UV package manager
- WhatsApp Business Account
- OpenAI API key
-
Install UV Package Manager:
pip install uv
-
Clone the Repository:
git clone https://github.com/yourusername/whatsapp-group-summary.git cd whatsapp-group-summary
-
Install Dependencies:
crewai install
- Visit Meta Developer Portal
- Create a new app or select existing one
- Add WhatsApp product to your app
- Complete business verification if required
- Navigate to WhatsApp > API Setup in your app dashboard
- Collect required credentials:
- Phone Number ID
- Access Token
- API Version (v17.0 recommended)
- Go to WhatsApp > Configuration
- Set up webhook URL for receiving messages
- Configure webhook events:
messages
- For receiving group messagesmessage_status
- For delivery confirmations
Create your configuration file:
cp src/whatsapp_crew/config/whatsapp_config.example.yaml whatsapp_config.yaml
Update with your credentials:
whatsapp:
api_version: "v17.0"
phone_number_id: "your_phone_number_id"
access_token: "your_access_token"
group_id: "your_group_id"
summary_time: "08:00"
timezone: "UTC"
Create .env
file in project root:
echo "OPENAI_API_KEY=your_openai_api_key" > .env
Start the AI crew:
crewai run
Modify agent behaviors and tasks in:
config/agents.yaml
- Agent definitionsconfig/tasks.yaml
- Task configurationscrew.py
- Core logic and toolsmain.py
- Input handling and execution flow
- Purpose: Manages WhatsApp communication and message processing
- Responsibilities:
- Monitors group chat activity using WhatsApp Business API
- Processes incoming messages and extracts metadata
- Handles message storage and retrieval
- Manages message retention and archival
- Tools:
whatsapp_tool.py
: WhatsApp Business API integrationmessage_storage.py
: Message persistence and retrievalcustom_tool.py
: Custom tool extensions
- Purpose: Analyzes content and generates insightful summaries
- Responsibilities:
- Performs message analysis and classification
- Generates and stores daily summaries
- Maintains summary archives
- Implements summary templates
- Tools:
message_analyzer.py
: Content analysis and classificationsummary_storage.py
: Summary persistence and retrieval
- WhatsApp Business API integration
- Message sending and receiving
- Group chat management
- Error handling and retry logic
- Content analysis and classification
- Topic identification
- Action item extraction
- Sentiment analysis
- Mention and hashtag processing
- Message persistence
- Data organization
- Retention policy implementation
- Query and retrieval functions
- Summary document management
- Template handling
- Archive organization
- Export functionality
- Template for implementing custom functionality
- Provides base structure for new tools:
- Input schema definition
- Tool description
- Execution logic
- Can be extended for:
- Custom message filters
- Special processing rules
- Integration with additional services
- Custom analytics
- Specialized data transformations
The system operates through five main tasks, each with specific responsibilities and scheduling:
- Agent: Message Handling Specialist
- Tools: WhatsApp Tool, Message Storage
- Schedule: Continuous operation
- Purpose: Real-time monitoring and processing of incoming messages
- Agent: Message Handling Specialist
- Tools: Message Storage, Custom Tool
- Schedule: Triggered on message receipt
- Purpose: Organized storage and management of processed messages
- Dependencies: Message Monitoring
- Agent: Summarization Specialist
- Tools: Message Analyzer
- Schedule: Daily execution
- Purpose: Content analysis and insight extraction
- Dependencies: Message Storage
- Agent: Summarization Specialist
- Tools: Message Analyzer, Summary Storage
- Schedule: Daily at midnight (UTC by default)
- Purpose: Creation of comprehensive daily summaries
- Dependencies: Message Analysis
- Agent: Message Handling Specialist
- Tools: WhatsApp Tool, Summary Storage
- Schedule: Daily at 8:00 AM (UTC by default)
- Purpose: Delivery of generated summaries to the WhatsApp group
- Dependencies: Summary Generation
The system follows a sequential workflow:
-
Continuous Monitoring: The Message Handler continuously monitors the WhatsApp group for new messages using the WhatsApp Tool.
-
Message Processing:
- New messages are immediately processed and stored
- Messages are organized by date and metadata
- Custom processing rules can be applied through the Custom Tool
-
Daily Analysis:
- Messages are analyzed for content and context
- Key topics and trends are identified
- Action items and important information are extracted
-
Summary Creation:
- Daily summaries are generated at midnight
- Content is organized by topic and importance
- Summaries are stored in both JSON and formatted text
-
Distribution:
- Formatted summaries are sent to the WhatsApp group at 8:00 AM
- Delivery confirmations are tracked
- Any distribution issues are handled with retry logic
You can customize the system behavior by modifying:
-
Scheduling:
- Adjust summary generation time in
tasks.yaml
- Modify distribution schedule
- Change timezone settings
- Adjust summary generation time in
-
Processing Rules:
- Implement custom message filters
- Add new analysis criteria
- Create custom summary formats
-
Storage Policies:
- Configure retention periods
- Modify archival rules
- Adjust storage organization
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Built with โค๏ธ using CrewAI