I tried to build a chess app, and the AI provided incorrect solutions to the puzzles, and puzzles which did not seem to have a solution. I would think that by understanding the rules, making puzzles like that should be very straightforward for a computer. It says Gemini makes mistakes, and I found that after several attempts, it was unable to solve the problem. Has anybody else had issues such as these?
All LLMs are not strong at chess, using them to generate and solve puzzles will lead to errors. Stockfish or Leela should be used as the chess ‘AI’, and puzzles can be obtained for free. For example, Lichess have an Open Database with over 5.5 million puzzles that can be downloaded - and used under the CC0 license.
I’m not entirely sure what you’re intending to build, but I can share my recent experience building a chess app, some of it may apply to you too.
I built a chess analysis app - very similar to the ‘Review game’ feature of chess.com. A user pastes in a PGN, the game is analysed, and a user can step through their game. The app was built in 4 hours, though I must admit, it was more of a ‘this will be fun project’ rather than anything serious or that I intend to release.
For this app, I used:
- chessground (react-chessground): provides the chess board UI + other features. It’s the same library Lichess uses.
- chess.js: the core logic for the chess engine.
- stockfish.js: can run in the browser, the main chess AI.
They are all available for free and will give you the core functionality of any chess app. Then in your case, if you wanted to add puzzles, you’d integrate the Lichess Open Database Puzzles data with this stack. Though I could be completely off base in terms of what you want to do.
