# ============================================================================= # SYNAPSE - Telegram Bot with Cerebras AI # Environment Configuration Example # ============================================================================= # ============================================================================= # REQUIRED CONFIGURATION # ============================================================================= # Telegram Bot Token (get from @BotFather) TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here # Cerebras AI API Key (get from cloud.cerebras.ai) CEREBRAS_API_KEY=your_cerebras_api_key_here # ============================================================================= # DATABASE CONFIGURATION # ============================================================================= # Database file path # For Docker: /app/data/bot_database.db (recommended for persistence) # For local: ./bot_database.db DATABASE_PATH=/app/data/bot_database.db # ============================================================================= # LOGGING CONFIGURATION # ============================================================================= # Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL) LOG_LEVEL=INFO # ============================================================================= # RATE LIMITING CONFIGURATION # ============================================================================= # Individual user rate limits (private chats and default for groups) RATE_LIMIT_MESSAGES_PER_MINUTE=10 RATE_LIMIT_WINDOW_SECONDS=60 # ============================================================================= # GROUP FEATURES CONFIGURATION # ============================================================================= # Enable/disable group chat functionality ENABLE_GROUP_FEATURES=true # Default memory mode for new groups (shared|personal) # - shared: Bot remembers conversations for the whole group # - personal: Bot remembers conversations per user individually DEFAULT_GROUP_MODE=shared # Default mention policy for groups (mention_only|all) # - mention_only: Bot responds only when @mentioned or replied to # - all: Bot responds to all messages in the group DEFAULT_GROUP_MENTION_POLICY=mention_only # Default maximum conversation context messages for groups GROUP_MAX_CONTEXT=40 # Default rate limits for groups DEFAULT_GROUP_RATE_LIMIT=50 DEFAULT_USER_RATE_LIMIT_IN_GROUPS=10 # ============================================================================= # DEPLOYMENT NOTES # ============================================================================= # Docker Deployment: # - Use DATABASE_PATH=/app/data/bot_database.db for data persistence # - Mount ./data:/app/data in docker-compose.yml # - Ensure proper file permissions for the data directory # Local Development: # - Use DATABASE_PATH=./bot_database.db # - Run with: uv run main.py # Security: # - Never commit this file with real API keys # - Use proper secret management in production # - Rotate API keys regularly # Performance: # - Adjust rate limits based on your usage patterns # - Monitor GROUP_MAX_CONTEXT to prevent memory issues # - Consider database backups for production deployments