Want to contribute? We'd love to have you on board! Please contact us at bilkentai@gmail.com before making any contributions.
BilGPT is an intelligent WhatsApp bot developed by Bilkent AI Society that combines AI-powered chat capabilities with content analysis. It serves as a versatile assistant for the Bilkent AI Society community, offering both conversational AI interactions and insightful content analysis.
Bilkent AI Society is a dynamic community at Bilkent University that brings together students passionate about artificial intelligence. In our first year, we've achieved remarkable milestones including:
- Hosting distinguished guests from leading tech companies, including OpenAI, Microsoft, NVIDIA, Meta, Google, and more!
- Being accepted into NVIDIA's AI Student Network and Notion Student Organizations.
- Achieving first place in Amazon's project competition.
- Organizing a huge event with Global Turks AI, inviting 13 alumni from top companies and institutions.
- Contributing to global AI initiatives, such as Cohere For AI's Aya project.
- Organizing major events, including Bilkent Philfest'23.
Learn more: ais.bilkent.edu.tr
Join our group: bilkentai.com
- Engage in meaningful discussions with AI on any topic
- Get context-aware responses when mentioning or replying to the bot
- Experience natural conversation flow with memory of chat history
- Receive well-reasoned arguments and explanations
- Share any URL and get AI-powered analysis of its content
- Receive detailed criticism and insights about the shared resources
- Understand different perspectives and potential biases
- Get structured summaries of articles and web content
- Monitor and manage group activities through admin commands
- Control bot's presence in different groups with ease
- Access debug information and system status for maintenance
- Manage group permissions and bot behavior
- WhatsApp API: whatsapp-web.js for WhatsApp integration
- AI/ML: OpenAI client for AI models for chat and content analysis
- Runtime: Node.js
- Storage: JSON-based persistent storage
- Testing: Jest for unit testing
- Code Quality: ESLint for code linting
- Version Control: Git
- Package Management: npm
The project is organized using a modular architecture:
βββ src/ # Source code directory
β βββ index.js # Main entry point
β βββ ai/ # AI functionality
β β βββ chatbot.js # AI chat response module
β β βββ critic.js # URL content analysis module
β βββ config/ # Configuration
β β βββ env.js # Environment configuration
β βββ handlers/ # Message and command handlers
β β βββ adminHandler.js # Admin command handling
β β βββ messageHandler.js # Message processing
β βββ prompts/ # System prompts for AI
β β βββ ai_bot_prompt.md # System prompt for chat
β β βββ critic_prompt.md # System prompt for URL analysis
β βββ services/ # Business logic and services
β β βββ debugService.js # Debug utilities
β β βββ groupManager.js # Group management functionality
β β βββ groupStorage.js # Persistent storage for groups
β βββ tests/ # Test files
β βββ utils/ # Utilities
β βββ clientUtils.js # WhatsApp client management
β βββ healthCheck.js # Health check endpoint
βββ data/ # Persistent data storage
β βββ active-groups.json # Stored active group IDs
βββ critics/ # Saved criticism data
βββ assets/ # Static assets
β βββ bilgpt-logo.png # Project logo
βββ README.md # Project documentation
- ai/chatbot.js: Provides AI chat responses with proper conversation context and memory
- ai/critic.js: Analyzes URLs and provides AI criticism with structured insights
- config/env.js: Centralizes environment variables and application configuration
- handlers/adminHandler.js: Manages admin commands, permissions, and group controls
- handlers/messageHandler.js: Processes incoming messages, handles URL analysis, and manages chat interactions
- prompts/ai_bot_prompt.md: System prompt for the AI chat functionality, defining personality and behavior
- prompts/critic_prompt.md: System prompt for URL analysis, setting analysis criteria and output format
- services/debugService.js: Provides debugging utilities and logging functionality
- services/groupManager.js: Handles group chat operations, monitoring, and management
- services/groupStorage.js: Provides persistent storage for active groups and settings
- Contains comprehensive test files for various components
- Includes unit tests, integration tests, and API tests
- utils/clientUtils.js: Handles WhatsApp client creation, setup, and graceful shutdown
- utils/healthCheck.js: Provides health check endpoints for monitoring system status
- index.js: Ties everything together, initializes the application, and manages the main bot lifecycle
Configuration is done through environment variables in a .env
file:
ADMIN_NUMBER=1234567890
OPENAI_API_KEY=your-openai-api-key
- Clone the repository
- Install dependencies with
npm install
- Copy
.env.example
to.env
and add your configuration - Start the bot with
npm start
- Scan the QR code with WhatsApp
The following commands are available for admin users:
/list
- List all available chats/debug
- Show detailed debug information/setactive <id>
- Set a group to be actively monitored/removeactive <id>
- Remove a group from active monitoring/active
- Show currently monitored groups/reset
- Reset admin chat ID (use with caution)
We welcome contributions from the Bilkent AI Society community and beyond. Please feel free to submit pull requests or open issues for any improvements or bug fixes.
Made with contrib.rocks.
This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.
The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
- This project is for non-commercial use only
- Any commercial use, including but not limited to:
- Using the bot for profit-making purposes
- Integrating the bot into commercial services
- Using the bot in a business context is strictly prohibited without explicit written permission from Bilkent AI Society.
For questions or support, please reach out to the Bilkent AI Society team:
- Email: bilkentai@gmail.com