{"data":{"kind":"file","path":"README.md","version_id":"st464htfiq6slr7vt8rh1igd","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":2852,"modified_at":"2025-09-07T22:16:54.054000","content_hash":"f3f08c93a1c798cb303b405e962a1abbe1d21b037304d45d042d5d1e78d96ae6"},"entries":[],"content":"# Diplomacy Environment for Prime Intellect\n\nA multi-agent reinforcement learning environment based on the classic board game Diplomacy, designed for training models in strategic negotiation, alliance formation, and long-term planning.\n\n## 🎯 What Makes This Special\n\nUnlike typical RL environments that focus on single-agent optimization, Diplomacy requires:\n- **Multi-agent negotiation**: 7 players must communicate and coordinate\n- **Trust dynamics**: Building and breaking alliances strategically  \n- **Theory of mind**: Understanding other agents' goals and deceptions\n- **Long-term planning**: Balancing immediate gains with relationships\n\n## 🚀 Quick Start\n\n```bash\n# Install the environment\nuv add diplomacy-env\n\n# Test it locally\nuv run vf-eval diplomacy-env -n 5 -r 2\n\n# Or use in your training pipeline\nfrom diplomacy_env import get_environment\n\nenv = get_environment(\n    max_years=10,\n    enable_press=True,  # Allow negotiation\n    scoring_mode=\"survival\"\n)\n```\n\n## 🎮 How It Works\n\nThe environment simulates a simplified game of Diplomacy with:\n1. **Diplomacy Phases**: Agents negotiate via messages\n2. **Order Phases**: Simultaneous military moves\n3. **Trust Tracking**: Reputation system for kept/broken promises\n4. **Dynamic Rewards**: Based on territory control and diplomatic success\n\n## 🤝 Contributing\n\nThis is an alpha version! I'd love help with:\n- Integrating a full Diplomacy engine (e.g., python-diplomacy)\n- Better reward shaping for cooperation vs betrayal\n- Adding visualization tools\n- Creating baseline agents\n\n## 📊 Metrics\n\nThe environment tracks:\n- Supply centers controlled\n- Trust levels between powers\n- Agreement compliance rate\n- Survival duration\n- Final ranking\n\n## 🏆 Why This Matters\n\nTraining models on Diplomacy could improve:\n- Business negotiation agents\n- Multi-stakeholder coordination\n- Political strategy analysis  \n- Game-theoretic reasoning\n\n## 🎲 Demo\n\nRun the interactive demo to see AI agents negotiate:\n\n```bash\npython run_diplomacy_demo.py\n```\n\nThis shows different AI personalities (aggressive, defensive, diplomatic) interacting, forming alliances, and making strategic betrayals!\n\n## 📈 Environment Configuration\n\n```python\n# Basic usage\nenv = get_environment()\n\n# Advanced configuration\nenv = get_environment(\n    max_years=15,           # Game length\n    enable_press=True,      # Allow negotiations\n    reward_betrayal=-0.5,   # Penalty for breaking alliances\n    reward_cooperation=0.3, # Bonus for keeping promises\n    scoring_mode=\"survival\" # \"survival\" or \"territory\"\n)\n```\n\n## 🔧 Development Setup\n\n```bash\n# Clone and install\ngit clone <your-repo>\ncd diplomacy-env\nuv add verifiers numpy pytest\n\n# Run tests\npython test_local.py\npytest\n\n# Run demo\npython run_diplomacy_demo.py\n```\n\nBuilt with ❤️ at University of Guelph for Prime Intellect's Environments Hub","encoding":"utf-8","truncated":false,"total_bytes":2852},"status":null}