LucasChess-AI-R6: AI-Enhanced Dual-Engine Chess Analytics
AI-enhanced Lucas Chess architecture refactored by Christopher Lazok, integrating DuckDB and SQLite dual-engine analytics, Sigmoid Elo and Glicko-2 rating models, Stockfish analysis, and LM Studio Grandmaster coaching.

DeepScout Chess
An independent, AI-enhanced desktop chess training platform featuring a dual-engine UCI sparring arena, real-time Tutor and Kibitzer companions, a Glicko-2 rating engine, an AI Grandmaster Coach (LM Studio / BYOK), and a multi-database analytics pipeline. Built with Tauri v2, React 19, and FastAPI.
๐ Key Features & Architectural Upgrades
1. โก Dual-Engine Vectorized Analytics (DuckDB + SQLite)
- DuckDB C++ Engine: ATTACHes SQLite database files in read-only mode (
ATTACH 'db.sqlite' AS db (TYPE SQLITE, READ_ONLY)) for instant vectorized aggregation across massive game databases. - SQLite CTE / NumPy Fallback: High-performance fallback query layer using SQLite Common Table Expressions and
numpyarray vectorization. - Live Progress Tracking: Replaced static blocking wait dialogs with a live
QProgressBarand time-remaining estimator (ProgressBarWithTime).
2. ๐ Rating Matrix Engine (Sigmoid ELO & Glicko-2)
- Depth-Aware Sigmoid ELO: Logistic accuracy-to-ELO conversion ($\text{ELO} = 800 + \frac{2000}{1 + e^{-0.08 \times (\text{Accuracy} - 72)}}$).
- Non-Book Accuracy Filtering: Automatically excludes opening book moves (
is_book == True) from accuracy calculations to prevent opening preparation inflation. - Phase-Weighted Accuracy: Weighted evaluation across game phases: Opening ($20%$), Middlegame ($50%$), Endgame ($30%$).
- Outlier Trimming: 10% trimmed mean / rolling median filtering to eliminate short draw miniatures or single-game blowouts from distorting rating trends.
- Multi-Game Glicko-2: Calculates rating ($R$), deviation ($RD$), and volatility ($\sigma$).
3. ๐ค AI Grandmaster Coach (LM Studio & BYOK)
- AI Performance Reviews: Asynchronous chat worker generating natural language performance analyses, color dynamics, and concrete training items.
- Local & Cloud Endpoints: Seamless support for local LLM servers via LM Studio (
http://localhost:1234/v1) or BYOK (Bring Your Own Key) OpenAI-compatible APIs. - Scouting Dossier Bridge: Exports rich JSON payloads (phase ACPL, error spectrum, tactical motifs) to LLM endpoints.
- Truthful Prompt Guardrails: System prompts strictly forbid hallucinating or substituting missing metrics.
4. ๐ก๏ธ Truthful 4-Tier Data Quality Pipeline
- Strict Quality Gating:
- Tier 0: Dirty/Invalid data (excluded from statistics).
- Tier 1: Basic PGN (valid games & results only).
- Tier 2: Elo-Ready (authoritative player ratings).
- Tier 3: Gold Standard (complete Stockfish move analysis for charts & reports).
- Transparent Exclusion Messaging: UI grids and dialogs explicitly report how many games were used versus excluded per metric, displaying
"โ"when metrics lack eligible data.
๐ ๏ธ Installation & Dependencies
Prerequisites
- Python 3.12+
- Operating System: Windows 10/11 (64-bit), Linux, macOS.
Required Python Libraries
pip install -r requirements.txt
Key packages: PySide6, duckdb>=1.0.0, numpy>=1.26.0, python-chess, requests, pillow, psutil.
Third-Party Attributions
DeepScout Chess incorporates the following open-source and public-domain assets:
- UCI Chess Engines: Stockfish (GPLv3), Patricia, CT800, Rodent II, Komodo/Dragon, Maia (lc0), and others โ each under their respective open-source licenses.
- Polyglot Opening Books: Public-domain opening book files.
- Chess Piece Sets: Ben Citak and Marc Graziani piece artwork, used under open license.
- XPV Move Encoding Format: Compact ASCII move encoding format originating from the Lucas Chess open-source project by Lucas Monge.
- License: GNU General Public License v2.0 or later (GPL-2.0-or-later). See LICENSE for details.