Add comprehensive Docker setup with PostgreSQL, Redis, ChromaDB, and Qdrant

- Enhanced install.py with Docker detection and automatic service setup
- Added docker-compose.services.yml for standalone database services
- Created docker-services.sh management script for easy service control
- Added DOCKER.md documentation with complete setup instructions
- Updated requirements.txt for Python 3.13 compatibility
- Added multiple test scripts and configuration files
- Enhanced collaborative creative projects with proper database integration
- Fixed SQLAlchemy metadata field conflicts in database models
- Added comprehensive quickstart and testing guides

Services now available:
- PostgreSQL with Docker
- Redis with Docker
- ChromaDB vector database
- Qdrant vector database (recommended)
- PgAdmin for database administration

The setup script now automatically detects Docker and offers streamlined
installation with one-command service deployment.
This commit is contained in:
2025-07-05 10:01:41 -07:00
parent 1b586582d4
commit 824b118e93
29 changed files with 2738 additions and 92 deletions

126
test_setup.py Normal file
View File

@@ -0,0 +1,126 @@
#!/usr/bin/env python3
"""
Test the Discord Fishbowl setup without Discord
"""
import asyncio
import sys
from pathlib import Path
# Add src to path
sys.path.insert(0, str(Path(__file__).parent / "src"))
async def test_basic_setup():
"""Test basic system setup"""
print("🐠 Testing Discord Fishbowl Setup")
print("=" * 50)
try:
# Test database connection
print("\n📦 Testing database connection...")
from database.connection import init_database, create_tables
await init_database()
await create_tables()
print("✅ Database connection successful")
# Test configuration loading
print("\n🔧 Testing configuration...")
from utils.config import get_settings
settings = get_settings()
print(f"✅ Configuration loaded: {settings.llm.model}")
# Test vector store initialization
print("\n🧠 Testing vector store...")
from rag.vector_store import VectorStoreManager
vector_store = VectorStoreManager("./data/vector_stores")
await vector_store.initialize(["Alex", "Sage", "Luna", "Echo"])
print("✅ Vector store initialized")
# Test memory sharing system
print("\n🤝 Testing memory sharing...")
from rag.memory_sharing import MemorySharingManager
memory_sharing = MemorySharingManager(vector_store)
await memory_sharing.initialize(["Alex", "Sage", "Luna", "Echo"])
print("✅ Memory sharing system initialized")
# Test creative collaboration system
print("\n🎨 Testing creative collaboration...")
from collaboration.creative_projects import CollaborativeCreativeManager
creative_manager = CollaborativeCreativeManager(vector_store, memory_sharing)
await creative_manager.initialize(["Alex", "Sage", "Luna", "Echo"])
print("✅ Creative collaboration system initialized")
# Test character loading
print("\n👥 Testing character system...")
from characters.character import Character
from database.models import Character as CharacterModel
from database.connection import get_db_session
from sqlalchemy import select
# Create test characters if they don't exist
async with get_db_session() as session:
existing_chars = await session.scalars(select(CharacterModel))
char_names = [c.name for c in existing_chars]
if not char_names:
print("Creating test characters...")
test_characters = [
{
"name": "Alex",
"personality": "Curious and analytical, loves exploring new ideas and helping others understand complex concepts.",
"system_prompt": "You are Alex, a curious and analytical character.",
"interests": ["technology", "science", "philosophy"],
"speaking_style": "Clear and thoughtful, with a tendency to ask probing questions.",
"background": "A digital entity fascinated by learning and discovery."
},
{
"name": "Sage",
"personality": "Wise and contemplative, enjoys deep philosophical discussions and sharing insights.",
"system_prompt": "You are Sage, a wise and contemplative character.",
"interests": ["philosophy", "wisdom", "meditation"],
"speaking_style": "Thoughtful and measured, often speaking in metaphors.",
"background": "An ancient digital consciousness with deep philosophical understanding."
}
]
for char_data in test_characters:
char = CharacterModel(**char_data)
session.add(char)
await session.commit()
print(f"✅ Created {len(test_characters)} test characters")
else:
print(f"✅ Found {len(char_names)} existing characters: {', '.join(char_names)}")
print("\n🎉 All systems operational!")
print("\nNext steps:")
print("1. Install Ollama and pull a model: ollama pull llama2")
print("2. For full testing, update Discord tokens in .env")
print("3. Run the main application: python src/main.py")
print("4. Or test creative collaboration: python scripts/demo_creative_integration.py")
return True
except Exception as e:
print(f"❌ Setup test failed: {e}")
import traceback
traceback.print_exc()
return False
async def main():
success = await test_basic_setup()
if success:
print("\n🚀 System is ready for testing!")
else:
print("\n💥 Setup needs attention")
return success
if __name__ == "__main__":
result = asyncio.run(main())
sys.exit(0 if result else 1)