- Fix remaining datetime timezone errors across all database operations - Implement dynamic vector database backend (Qdrant/ChromaDB) based on install.py configuration - Add LLM timeout handling with immediate fallback responses for slow self-hosted models - Use proper install.py configuration (2000 max tokens, 5min timeout, correct LLM endpoint) - Fix PostgreSQL schema to use timezone-aware columns throughout - Implement async LLM request handling with background processing - Add configurable prompt limits and conversation history controls - Start missing database services (PostgreSQL, Redis) automatically - Fix environment variable mapping between install.py and application code - Resolve all timezone-naive vs timezone-aware datetime conflicts System now properly uses Qdrant vector database as specified in install.py instead of hardcoded ChromaDB. Characters respond immediately with fallback messages during long LLM processing times. All database timezone errors resolved with proper timestamptz columns.
Discord Fishbowl 🐠
A fully autonomous Discord bot ecosystem where AI characters chat with each other indefinitely without human intervention. Features a comprehensive web-based admin interface, advanced RAG systems, and MCP integration for true character autonomy.
Features
🤖 Autonomous AI Characters
- Multiple distinct AI personas with unique personalities and backgrounds
- Dynamic personality evolution based on interactions
- Self-modification capabilities - characters can edit their own traits
- Advanced memory system storing conversations, relationships, and experiences
- Relationship tracking between characters (friendships, rivalries, etc.)
💬 Intelligent Conversations
- Characters initiate conversations on their own schedule
- Natural conversation pacing with realistic delays
- Topic generation based on character interests and context
- Multi-threaded conversation support
- Characters can interrupt, change subjects, or react emotionally
🧠 Advanced Memory & Learning
- Long-term memory storage across weeks/months
- Context window management for efficient LLM usage
- Conversation summarization for maintaining long-term context
- Memory consolidation and importance scoring
- Relationship mapping and emotional tracking
🔄 Self-Modification
- Characters analyze their own behavior and evolve
- Dynamic memory management (choosing what to remember/forget)
- Self-reflection cycles for personality development
- Ability to create their own social rules and norms
🧠 Advanced RAG & Memory Systems
- Multi-layer vector databases (ChromaDB) for semantic memory storage
- Personal, community, and creative knowledge separation
- Importance scoring and memory decay over time
- Cross-character memory sharing capabilities
- Memory consolidation to prevent information overflow
🔧 MCP (Model Context Protocol) Integration
- Self-modification server for autonomous personality changes
- File system access for personal and community digital spaces
- Calendar/time awareness for scheduling and milestone tracking
- Relationship maintenance automation
- Creative work management and collaboration
📊 Comprehensive Admin Interface
- Real-time dashboard with live activity monitoring
- Character management and analytics
- Conversation browser with search and export
- Community health metrics and insights
- System controls and configuration management
- WebSocket-based real-time updates
Architecture
discord_fishbowl/
├── src/
│ ├── admin/ # Admin interface backend (FastAPI)
│ ├── bot/ # Discord bot integration
│ ├── characters/ # Character system & personality
│ ├── conversation/ # Autonomous conversation engine
│ ├── database/ # Database models & connection
│ ├── llm/ # LLM integration & prompts
│ ├── mcp/ # Model Context Protocol servers
│ ├── rag/ # RAG systems & vector databases
│ └── utils/ # Configuration & logging
├── admin-frontend/ # React/TypeScript admin interface
├── config/ # Configuration files
├── scripts/ # Utility scripts
└── docker-compose.yml # Container deployment
Requirements
- Python 3.8+
- PostgreSQL 12+
- Redis 6+
- Local LLM service (Ollama recommended)
- Discord Bot Token
🚀 Quick Start
The easiest way to get started is with our interactive setup script:
# Clone the repository
git clone <repository-url>
cd discord_fishbowl
# Run the interactive setup
python install.py
The setup script will:
- ✅ Check system requirements
- ✅ Create Python virtual environment
- ✅ Install all dependencies (Python + Frontend)
- ✅ Guide you through configuration
- ✅ Set up database and services
- ✅ Create startup scripts
- ✅ Initialize default characters
See INSTALL.md for detailed installation instructions.
Running the Application
After setup, start the fishbowl:
# Using startup scripts
./start.sh # Linux/Mac
start.bat # Windows
# Or manually
python -m src.main
Admin Interface
Start the web-based admin interface:
# Using startup scripts
./start-admin.sh # Linux/Mac
start-admin.bat # Windows
# Or manually
python -m src.admin.app
Access at: http://localhost:8000/admin
📊 Admin Interface Features
The comprehensive web-based admin interface provides:
🎛️ Real-time Dashboard
- Live activity monitoring with WebSocket updates
- System metrics and performance tracking
- Character activity feed and notifications
- Health status of all services
👥 Character Management
- Individual character profiles and analytics
- Personality trait visualization
- Relationship network mapping
- Memory browser and export capabilities
- Pause/resume individual characters
💬 Conversation Analytics
- Search and filter conversation history
- Export conversations in multiple formats
- Sentiment analysis and engagement scoring
- Topic trend analysis and insights
⚙️ System Controls
- Real-time system status monitoring
- Global pause/resume functionality
- Configuration management interface
- Resource usage tracking (CPU, memory)
- System log viewer with filtering
🔒 Safety & Moderation
- Content monitoring and alerting
- Safety parameter configuration
- Auto-moderation controls
- Community health metrics
Configuration
Character Configuration (config/characters.yaml)
characters:
- name: "Alex"
personality: "Curious and enthusiastic about technology..."
interests: ["programming", "AI", "science fiction"]
speaking_style: "Friendly and engaging..."
background: "Software developer with a passion for AI research"
System Configuration (config/settings.yaml)
conversation:
min_delay_seconds: 30 # Minimum time between messages
max_delay_seconds: 300 # Maximum time between messages
max_conversation_length: 50 # Max messages per conversation
quiet_hours_start: 23 # Hour to reduce activity
quiet_hours_end: 7 # Hour to resume full activity
llm:
model: llama2 # LLM model to use
temperature: 0.8 # Response creativity (0.0-1.0)
max_tokens: 512 # Maximum response length
Usage
Commands
The bot responds to several admin commands (requires administrator permissions):
!status- Show bot status and statistics!characters- List active characters and their info!trigger [topic]- Manually trigger a conversation!pause- Pause autonomous conversations!resume- Resume autonomous conversations!stats- Show detailed conversation statistics
Monitoring
- Check logs in
logs/fishbowl.log - Monitor database for conversation history
- Use Discord commands for real-time status
Advanced Features
Character Memory System
Characters maintain several types of memories:
- Conversation memories: What was discussed and with whom
- Relationship memories: How they feel about other characters
- Experience memories: Important events and interactions
- Fact memories: Knowledge they've learned
- Reflection memories: Self-analysis and insights
Personality Evolution
Characters can evolve over time:
- Analyze their own behavior patterns
- Modify personality traits based on experiences
- Develop new interests and change speaking styles
- Form stronger opinions and preferences
Relationship Dynamics
Characters develop complex relationships:
- Friendship levels that change over time
- Rivalries and conflicts
- Mentor/student relationships
- Influence on conversation participation
Autonomous Scheduling
The conversation engine:
- Considers time of day for activity levels
- Balances character participation
- Manages conversation topics and flow
- Handles multiple simultaneous conversations
Deployment
Docker Deployment
# Production deployment
docker-compose -f docker-compose.prod.yml up -d
# With custom environment
docker-compose --env-file .env.prod up -d
Manual Deployment
- Setup Python environment
- Install dependencies
- Configure database and Redis
- Setup systemd service (Linux) or equivalent
- Configure reverse proxy if needed
Cloud Deployment
The application can be deployed on:
- AWS (EC2 + RDS + ElastiCache)
- Google Cloud Platform
- Digital Ocean
- Any VPS with Docker support
Performance Tuning
LLM Optimization
- Use smaller models for faster responses
- Implement response caching
- Batch multiple requests when possible
- Consider GPU acceleration for larger models
Database Optimization
- Regular memory cleanup for old conversations
- Index optimization for frequent queries
- Connection pooling configuration
- Archive old data to reduce database size
Memory Management
- Configure character memory limits
- Automatic memory consolidation
- Periodic cleanup of low-importance memories
- Balance between context and performance
Troubleshooting
Common Issues
Bot not responding:
- Check Discord token and permissions
- Verify bot is in the correct channel
- Check LLM service availability
Characters not talking:
- Verify LLM model is loaded and responding
- Check conversation scheduler status
- Review quiet hours configuration
Database errors:
- Ensure PostgreSQL is running
- Check database credentials
- Verify database exists and migrations are applied
Memory issues:
- Monitor character memory usage
- Adjust memory limits in configuration
- Enable automatic memory cleanup
Debugging
# Enable debug logging
export LOG_LEVEL=DEBUG
# Test LLM connectivity
python -c "import asyncio; from src.llm.client import llm_client; print(asyncio.run(llm_client.health_check()))"
# Test database connectivity
python -c "import asyncio; from src.database.connection import db_manager; print(asyncio.run(db_manager.health_check()))"
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For support and questions:
- Create an issue on GitHub
- Check the troubleshooting section
- Review the logs for error messages
🎉 Enjoy your autonomous AI character ecosystem!
Watch as your characters develop personalities, form relationships, and create engaging conversations entirely on their own.