A chess engine / AI project built in Python (with SQL backend, machine learning, and a frontend) aiming to emulate the author’s playing style via adaptive models.
Expected completion date: October 10, 2025
This project is an attempt to build a chess AI that mimics a player’s style by training models on their game data. It combines chess logic, data storage, and machine learning to evolve an adaptive opponent.
It is being developed using Python, SQL, and specialized chess / ML libraries. Future improvements include increasing the size of the dataset, along with incorporating a Reinforcement Learning with Human Feedback (RLHF) model.
- Chess move validation, game state management
- Adaptive AI opponents trained on personal game data
- ML Analysis, combined usage of convolutional, recurrent, and graph neural networks.
- Frontend (UI) + backend API
- Persistence (SQL database) for storing games, model checkpoints, etc.
- Logging, metrics, evaluation
| Component | Technology / Library |
|---|---|
| Language | Python |
| Database | SQL |
| Chess Logic | python-chess |
| ML / AI | PyTorch / PyTorch Geometric |
| Frontend | Vue.js / HTML / TypeScript / etc. |
| API / Backend | Flask |
- Python 3.8+
- pip
- A SQL database (e.g. MySQL for local dev)
- GPU if training large models (Optional, i.e. "cuda" engine)
- node / npm for frontend functionality
git clone https://github.com/AbElo-77/Python-Chess.git
cd Python-Chess
python -m venv venv
source venv/bin/activate # macOS / Linux
venv\Scripts\activate # Windows
pip install pytorch
pip install pytorch-geometric
pip install pandasChoose the NN model you want to train, Convolutional, Recurrent, or Graph.
python -m backend.index # Run The Flask Backend
cd frontend
npm run dev - Upload 10-20K personal games or use a public dataset (recommended).
-
- Lichess for multi-million game PGN files, but can splice for the first couple thousand games.
- Trained chosen model using the same class number, len(move_to_id).
Upcoming planned improvements include
- Alpha release: basic AI vs human with learned model + shallow search
- Analytics dashboard: graphs of your style, mistakes, openings repertoire
- Tuning control: user can shift AI style weight (aggressive, passive, unpredictable)
- Self-play mode: model plays against itself to generate synthetic training data
- Multiplayer mode / online server support (WebSocket integration)
- Persisted user accounts, game history sync
- Support for variant chess modes (Chess960, bughouse)
- Model improvements: transformer-based models, reinforcement learning, meta-learning
Please contribute using PEP8 guidelines and updating the README, or contact me using the contacts below.
This project is licensed under the MIT license.
- GitHub: AbElo-77
- Email: abdallaelokely@gmail.com