AI_Diplomacy  by EveryInc

AI agents for turn-based strategy game Diplomacy

created 5 months ago
535 stars

Top 60.1% on sourcepulse

GitHubView on GitHub
Project Summary

This repository extends the original Diplomacy game engine to integrate Large Language Models (LLMs) for enhanced AI-driven gameplay. It enables multi-turn negotiations, LLM-generated orders, and automatic phase summaries, targeting developers and researchers interested in AI-assisted strategy games.

How It Works

The core innovation lies in orchestrating LLM interactions within the Diplomacy game loop. lm_game.py manages conversation rounds and calls LLM clients to generate orders. lm_service_versus.py provides a base client for various LLM APIs (OpenAI, Claude, Gemini, DeepSeek), handling prompt construction and response parsing. The DiplomacyAgent class in agent.py maintains state, including goals and relationships, to ensure consistent strategic play. Phase summaries are generated by modifying the game engine to provide textual recaps of turn events.

Quick Start & Requirements

  • Install with: pip install diplomacy
  • Compatible with Python 3.5, 3.6, and 3.7.
  • For web interface: requires Node.js (via NVM), npm install, and python -m diplomacy.server.run.
  • Documentation: diplomacy.readthedocs.io

Highlighted Details

  • Supports OpenAI, Claude, Gemini, and DeepSeek LLMs for order generation.
  • Implements stateful agents with goals, relationships, and journals for strategic continuity.
  • Includes an experimental web interface for playing against bots and visualizing games.
  • Allows for network play via websockets.

Maintenance & Community

The project is part of the EveryInc organization. Further community and development details are not explicitly detailed in the README.

Licensing & Compatibility

  • Licensed under the APGLv3 License.
  • The AGPLv3 license is a strong copyleft license, requiring derivative works to also be open-sourced under the same license. This may impose restrictions on commercial use or linking with closed-source software.

Limitations & Caveats

The project is explicitly marked as experimental and under active development, with features subject to change. Python version compatibility is limited to 3.5-3.7, which is outdated. Future explorations mention longer conversation phases and enhanced agent memory, indicating current limitations in these areas.

Health Check
Last commit

2 days ago

Responsiveness

1 day

Pull Requests (30d)
6
Issues (30d)
2
Star History
329 stars in the last 90 days

Explore Similar Projects

Starred by Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
2 more.

chatarena by Farama-Foundation

0.3%
1k
Multi-agent environment for LLM research
created 2 years ago
updated 1 year ago
Feedback? Help us improve.