Chess Analytics Engine

Upload a batch of games and get two independent model scores per game for signs of engine assistance, streamed to the browser one game at a time as each finishes.

Built with
Go, Python, PyTorch, XGBoost, Kafka (Redpanda), PostgreSQL, Flask, Docker
Code
CosmicVeil/ChessAnalyticsEngine

Overview

Each finished game becomes one feature vector. A PyTorch network and an XGBoost model score that vector in separate processes, and the two scores are joined into one result. Showing both side by side makes disagreement visible: a game where the models disagree deserves a closer look, not a verdict.

The scores run from zero to one, but they are not calibrated probabilities, and the app says so. They flag games for review; they do not prove cheating.

How it works

  1. Flask accepts a PGN upload or paste, spools it to private disk storage rather than holding it in memory, and records a job in PostgreSQL.
  2. An ingestion worker publishes every move to a chess-moves topic on Kafka.
  3. A Go service extracts per-move features, and an aggregation stage turns them into one row per game: the mean, standard deviation, minimum, maximum and last value of every feature, plus the move count.
  4. The PyTorch and XGBoost workers each score the game. Neither imports the other, and Flask imports neither.
  5. A result worker joins the two scores, stores them, and writes an ordered event that the browser receives over Server-Sent Events.