HalfMind is a handcrafted chess engine written in Python, designed to play sharp, principled openings and dynamic middlegame positions.
It deliberately keeps endgame heuristics lightweight, resulting in aggressive, human-like play that can dominate early phases but occasionally struggles to convert in simplified positions — a conscious design tradeoff.
Sharp ideas, short memory.
HalfMind was built to explore classical chess engine design rather than neural networks. The focus is on search quality, move ordering, and real-time decision making under time constraints.
The engine is exposed through a web interface that allows users to play against it directly, adjust difficulty, and visualize evaluations.
-
Minimax with Alpha–Beta pruning
-
Iterative deepening with aspiration windows
-
Transposition tables (hash-based caching)
-
Quiescence search for tactical stability
-
Move ordering heuristics:
- Checks
- Promotions
- MVV–LVA captures
- Killer moves
- Positional (PST) tie-breakers
-
Late Move Reductions (LMR)
- Material balance
- Piece-Square Tables (PST)
- Passed pawn bonuses
- Basic endgame detection
Endgame logic is intentionally minimal to prioritize speed and middlegame sharpness.
The engine is wrapped in a Flask-based web application with a modern UI.
- Drag-and-drop chessboard (chessboard.js)
- Adjustable search depth
- Adjustable time limit
- Live evaluation bar
- Move history (PGN-style)
- Undo, board flip, FEN copy
- Docker-ready deployment
Experience HalfMind Chess Engine live: https://halfmind-chess-engine.onrender.com/
- Python 3.10+
- pip
pip install -r requirements.txtpython app.py- Depth and time limits are hard-capped server-side to prevent abuse.
- Designed for single-worker execution (CPU-bound engine).
- Not intended for massive concurrency (yet).
- Weak endgame technique in low-material positions
- No tablebases
- No neural evaluation (NNUE)
- No UCI protocol (web-first design)
These are conscious tradeoffs, not oversights.
- Demonstrate understanding of search-based AI
- Build a full-stack system around a non-trivial algorithm
- Prioritize clarity, correctness, and controllable behavior
- Embrace imperfection as part of the engine’s identity
- Python (engine & backend)
- Flask (web server)
- python-chess (board representation)
- JavaScript + chessboard.js (frontend)
- Docker (deployment)
This project is intended for educational and demonstration purposes.
Built by an engineering student as an exploration of classical game AI, search optimization, and systems integration.