AI-Powered Debate Arena — Challenge an AI that argues the opposite of any position you take.
| Feature | Description |
|---|---|
| 🧠 AI Debate Opponent | Powered by Google Gemini 2.0 Flash |
| 🎭 3 Debate Modes | Logical, Aggressive, Devil's Advocate |
| 💬 Conversation Memory | AI remembers context from previous exchanges |
| � Debate Scoring | Get scored on Logic, Evidence, Persuasion, Rebuttal |
| �🎤 Voice Input | Speak your arguments using Web Speech API |
| 🌙 Theme Toggle | Dark/Light mode with persistence |
| 🌟 Particle Effects | Floating neon particle background |
| ⌨️ Typing Animation | AI responses appear with typewriter effect |
| 🔊 Sound Effects | Audio feedback (toggleable) |
| 📱 Mobile Friendly | Responsive design with collapsible sidebar |
git clone <your-repo-url>
cd Debate_Gravity
pip install -r requirements.txtGet your free API key from Google AI Studio
Create a .env file:
GEMINI_API_KEY=your_api_key_herepython app.pyOpen http://127.0.0.1:5000 in your browser 🎉
| Shortcut | Action |
|---|---|
Enter |
Send message |
Ctrl + K |
Clear chat history |
Ctrl + M |
Toggle microphone |
Ctrl + / |
Toggle theme |
Debate_Gravity/
├── app.py # Flask backend + Gemini AI
├── requirements.txt # Python dependencies
├── .env # API key (create this)
├── .env.example # API key template
└── templates/
└── index.html # Frontend UI
- Backend: Python, Flask, Flask-CORS
- AI: Google Gemini 2.0 Flash
- Frontend: HTML5, Tailwind CSS, Vanilla JS
- Features: Web Speech API, LocalStorage, CSS Animations
Note: Create a screenshots folder and add your images
| Mode | Behavior |
|---|---|
| Logical | Calm, academic counter-arguments |
| Aggressive | Sharp, forceful rebuttals |
| Devil's Advocate | Argues the opposite no matter what |
Send a debate message to the AI with conversation history.
{
"message": "Climate change is real",
"mode": "logical",
"history": [
{"user": "Previous message", "ai": "Previous response"}
]
}Response:
{
"response": "While climate data shows warming trends...",
"historyLength": 3
}Score your debate performance (requires 2+ exchanges).
{
"history": [
{"user": "...", "ai": "..."},
{"user": "...", "ai": "..."}
]
}Response:
{
"score": {
"logic": 20,
"evidence": 18,
"persuasion": 22,
"rebuttal": 15,
"total": 75,
"feedback": "Strong logical arguments. Add more evidence."
}
}Get system status and debate statistics.
{
"status": "online",
"count": 42,
"recent": ["AI Safety", "Mars Colony"]
}- Fork the repo
- Create a feature branch (
git checkout -b feature/amazing) - Commit changes (
git commit -m 'Add amazing feature') - Push (
git push origin feature/amazing) - Open a Pull Request
MIT License - feel free to use this for your hackathon! 🏆
Made with ❤️ for hackathons
"The measure of intelligence is the ability to change." — Albert Einstein


