A multi-agent philosophical debate platform powered by the GitHub Copilot SDK. Six AI agents embodying different philosophical traditions debate life's deepest questions, with a moderator synthesizing the final answer.
Philosophers
| Agent | Tradition | Core Focus |
|---|---|---|
| ποΈ Marcus | Stoic | Virtue, self-mastery, accepting what we cannot control |
| π Jean-Paul | Existentialist | Freedom, authenticity, creating our own meaning |
| πͺ· Thich | Buddhist | Impermanence, non-attachment, compassion |
| π§ William | Pragmatist | Practical consequences, what works in reality |
| π¬ RenΓ© | Rationalist | Reason, logic, first principles |
| πͺ Albert | Absurdist | Embracing life's absurdity with revolt and joy |
Features
- Real-time debates: Watch philosophers respond and challenge each other via Server-Sent Events
- Moderator synthesis: A final synthesis highlighting agreements, tensions, and insights
- Persistence: Debates are saved to database (SQLite for dev, PostgreSQL for production)
- History: Browse and revisit past debates
Tech Stack
- Backend: Python Flask
- AI Runtime: GitHub Copilot SDK
- Database: SQLAlchemy (SQLite / PostgreSQL)
- Frontend: Vanilla JS with SSE streaming
- Deployment: Azure Web App + Azure PostgreSQL
Quick Start
Prerequisites
- GitHub Copilot CLI installed and authenticated
- Python 3.8+
Local Development
# Clone the repository git clone https://github.com/yourusername/debatechamber.git cd debatechamber # Create virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install dependencies pip install -r requirements.txt # Copy environment file cp .env.example .env # Run the application python app.py
Visit http://localhost:5000 to start debating!
Azure Deployment
1. Create Azure Resources
# Create resource group az group create --name debate-chamber-rg --location eastus # Create PostgreSQL server az postgres flexible-server create \ --resource-group debate-chamber-rg \ --name debate-chamber-db \ --admin-user adminuser \ --admin-password <your-password> \ --sku-name Standard_B1ms # Create database az postgres flexible-server db create \ --resource-group debate-chamber-rg \ --server-name debate-chamber-db \ --database-name debatechamber # Create Web App az webapp create \ --resource-group debate-chamber-rg \ --plan debate-chamber-plan \ --name debate-chamber-app \ --runtime "PYTHON:3.11"
2. Configure Environment Variables
In Azure Portal, navigate to your Web App > Configuration > Application settings:
DATABASE_URL=postgresql://adminuser:<password>@debate-chamber-db.postgres.database.azure.com:5432/debatechamber?sslmode=require
FLASK_SECRET_KEY=<generate-a-secure-key>
FLASK_ENV=production
COPILOT_GITHUB_TOKEN=ghp_your_github_pat_with_copilot_access
3. Configure Startup Command
Set the startup command to: startup.sh
4. Deploy
# Deploy using Azure CLI
az webapp up --name debate-chamber-app --resource-group debate-chamber-rgAuthentication & Multi-User Access
How Authentication Works
The Copilot SDK requires authentication to access AI models. There are three options:
Option 1: Single-Owner Mode (Your Subscription)
Best for personal projects or demos where YOU pay for all usage.
- Create a GitHub Personal Access Token (PAT) with "Copilot Requests" scope
- Set
COPILOT_GITHUB_TOKENenvironment variable in Azure - All API calls are billed to your Copilot subscription
# In Azure App Settings
COPILOT_GITHUB_TOKEN=ghp_your_personal_access_tokenOption 2: BYOK - Bring Your Own Key (Enterprise)
Best for organizations wanting to use their own LLM API keys.
- Go to GitHub Enterprise Settings β Copilot β Models β Custom Models
- Add API keys from: OpenAI, Anthropic, Azure OpenAI, AWS Bedrock, Google AI
- The SDK automatically uses your organization's configured keys
- Billing goes directly to your LLM provider
Supported providers:
- OpenAI
- Anthropic (Claude)
- Azure OpenAI
- AWS Bedrock
- Google AI Studio
- xAI (Grok)
Option 3: Per-User OAuth (Each User Pays)
Best for apps where each user has their own Copilot subscription.
- Implement GitHub OAuth login in your app
- Pass each user's token to the SDK
- Each user's API calls are billed to their own subscription
Environment Variables
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
Database connection string | sqlite:///debates.db |
FLASK_SECRET_KEY |
Session encryption key | dev-secret-key-... |
FLASK_ENV |
Environment (development/production) |
development |
COPILOT_GITHUB_TOKEN |
GitHub PAT for Copilot access | (uses CLI auth) |
COPILOT_MODEL |
AI model to use | gpt-4.1 |
Project Structure
debatechamber/
βββ app.py # Flask application & routes
βββ config.py # Configuration management
βββ models.py # SQLAlchemy database models
βββ philosophers.py # Agent definitions & prompts
βββ requirements.txt # Python dependencies
βββ startup.sh # Azure startup script
βββ .env.example # Environment template
βββ static/
β βββ style.css # Styling
βββ templates/
βββ index.html # Main debate page
βββ debates.html # Debate history list
βββ debate_detail.html # Individual debate view
License
MIT Philosophical Debate Chamber