♟️ Chess AI Agents
Welcome to chess AI agents — an interactive AI vs AI chess game built with Streamlit, Python-Chess, and AutoGen (OpenAI). Two powerful language models face off on the board, making moves in real time, while you watch the strategy unfold! 🤖⚔️🤖
🚀 Features
✅ AI vs AI chess match powered by GPT models
✅ Real-time chessboard visualization with SVG rendering
✅ User-friendly web interface via Streamlit
✅ Game coordination via AutoGen's ConversableAgent framework
✅ Full move history and end-of-game detection (checkmate, stalemate, etc.)
✅ Configurable number of turns and full reset capability
✅ Modular, clean codebase for easy extension
🔑 Requirements
Python 3.8+
An OpenAI API key
An Internet connection to access OpenAI models (GPT-4o or GPT-3.5-turbo)
🧠 How It Works
Two agents (
Agent_White
andAgent_Black
) are powered by OpenAI LLMs using AutoGen.A Game_Master agent handles validation and game coordination.
Each agent queries available moves, selects one, and executes it.
The board state is visualized after each move.
The user configures the number of moves and watches the AI play!
⚙️ Configuration
🔐 Enter your OpenAI API key in the sidebar
♟️ Choose the number of turns (recommended: 5–10 for demo)
▶️ Click Start Game to begin the AI chess match
🛠️ Future Improvements
🎮 Add human vs AI mode
📄 PGN export of games
🤖 Local model support (e.g., LLaMA, Mistral)
🔁 Multiple game modes and agent personalities
📜 License
📄 This project is released under the MIT License.